{"id":22,"date":"2024-04-04T03:16:33","date_gmt":"2024-04-04T00:16:33","guid":{"rendered":"https:\/\/sisu.ut.ee\/robot\/56-ir-vastuvotja\/"},"modified":"2024-04-04T03:16:43","modified_gmt":"2024-04-04T00:16:43","slug":"56-ir-vastuvotja","status":"publish","type":"page","link":"https:\/\/sisu.ut.ee\/robot\/56-ir-vastuvotja\/","title":{"rendered":"5.6. IR-vastuv\u00f5tja"},"content":{"rendered":"<p>mBot-i peal olevad andurid hakkavad otsa saama. Viimane, mis j\u00e4\u00e4nud, on IR-vastuv\u00f5tja. Sellest videost n\u00e4edki, kuidas seda kasutada ja mis \u00fclesandeid sellega t\u00e4idetakse. Samuti saad teada, mis tingimustel IR-vastuv\u00f5tjat on m\u00f5istlik anduriks lugeda.<\/p>\n<p><\/p><div class=\"ratio ratio-16x9 mb-3\"><div class=\"video-placeholder-wrapper video-placeholder-wrapper--16x9\">\n\t\t\t    <div class=\"video-placeholder d-flex justify-content-center align-items-center\">\n\t\t\t        <div class=\"overlay text-white p-2 w-100 text-center d-block justify-content-center align-items-center\">\n\t\t\t            <div>Kolmandate osapoolte sisu n\u00e4gemiseks palun n\u00f5ustu k\u00fcpsistega.<\/div>\n\t\t\t            <button class=\"btn btn-secondary btn-sm mt-1 consent-change\">Muuda n\u00f5usolekut<\/button>\n\t\t\t        <\/div>\n\t\t\t    <\/div>\n\t\t\t<\/div>\n<\/div>\n<p style=\"text-align: center\"><a href=\"https:\/\/youtu.be\/5onEbdhbjnY\" target=\"_blank\" rel=\"noopener\">https:\/\/youtu.be\/5onEbdhbjnY<\/a><\/p>\n<div class=\"valem-m6tlekaasa\">\n<h3><img loading=\"lazy\" decoding=\"async\" width=\"40\" height=\"33\" class=\"alignnone wp-image-28\" src=\"https:\/\/sisu.ut.ee\/wp-content\/uploads\/sites\/198\/robot_motle.png\" title=\"robot_motle.png\" alt=\"robot_motle.png\">Tee kaasa!<\/h3>\n<p><strong>Kirjuta valmis programm, mis loeb puldi saadetud koode ja saadab need Serial-i abil arvutisse. Uuri, kas k\u00f5ik nupud t\u00f6\u00f6tavad samamoodi, kui tabelis antud. Ega tabelist juhuslikult m\u00f5ni nupp puudu ei ole?<\/strong><\/p>\n<\/div>\n<p>\u00a0<\/p>\n<div class=\"valem-m6tlekaasa\">\n<h3><img loading=\"lazy\" decoding=\"async\" width=\"40\" height=\"33\" class=\"alignnone wp-image-28\" src=\"https:\/\/sisu.ut.ee\/wp-content\/uploads\/sites\/198\/robot_motle.png\" title=\"robot_motle.png\" alt=\"robot_motle.png\">Pea meeles!<\/h3>\n<p><strong>mBot-i IR-vastuv\u00f5tja kasutamiseks peab:<\/strong><\/p>\n<ul>\n<li><strong>Kasutama mBot-i teeki: \u201c#include &lt;MeMCore.h&gt;\u201d<\/strong><\/li>\n<li><strong>Vastuv\u00f5tja initsialiseerima: \u201cMeIR ir;\u201d<\/strong><\/li>\n<li><strong>Vastuv\u00f5tjat kontrollima: \u201cif (ir.decode()) {}\u201d<\/strong><\/li>\n<li><strong>Vastuv\u00f5tjast koodi lugema: \u201cint kood = ir.value &gt;&gt; 16 &amp; 0xFF;\u201d<\/strong><\/li>\n<\/ul>\n<\/div>\n<p>\u00a0<\/p>\n<p>Siit leiad ka tabeli mBot-i puldi nuppudele vastavate koodidega:<\/p>\n<table class=\"table table-hover\" style=\"border-color: #eeeeee;border-width: 1px;border-style: solid\" border=\"1\" align=\"center\">\n<tbody>\n<tr>\n<td align=\"center\">\n<p><strong>Nupp<\/strong><\/p>\n<\/td>\n<td align=\"center\">\n<p><strong>Kood<\/strong><\/p>\n<\/td>\n<td>\n<p style=\"text-align: center\"><strong>mBot-i t\u00e4hised<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">\n<p>1<\/p>\n<\/td>\n<td align=\"center\">\n<p>12<\/p>\n<\/td>\n<td>\n<p>IR_BUTTON_1<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">\n<p>2<\/p>\n<\/td>\n<td align=\"center\">\n<p>24<\/p>\n<\/td>\n<td>\n<p>IR_BUTTON_2<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">\n<p>3<\/p>\n<\/td>\n<td align=\"center\">\n<p>94<\/p>\n<\/td>\n<td>\n<p>IR_BUTTON_3<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">\n<p>4<\/p>\n<\/td>\n<td align=\"center\">\n<p>8<\/p>\n<\/td>\n<td>\n<p>IR_BUTTON_4<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">\n<p>5<\/p>\n<\/td>\n<td align=\"center\">\n<p>28<\/p>\n<\/td>\n<td>\n<p>IR_BUTTON_5<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">\n<p>6<\/p>\n<\/td>\n<td align=\"center\">\n<p>90<\/p>\n<\/td>\n<td>\n<p>IR_BUTTON_6<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">\n<p>7<\/p>\n<\/td>\n<td align=\"center\">\n<p>66<\/p>\n<\/td>\n<td>\n<p>IR_BUTTON_7<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">\n<p>8<\/p>\n<\/td>\n<td align=\"center\">\n<p>82<\/p>\n<\/td>\n<td>\n<p>IR_BUTTON_8<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">\n<p>9<\/p>\n<\/td>\n<td align=\"center\">\n<p>74<\/p>\n<\/td>\n<td>\n<p>IR_BUTTON_9<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">\n<p>0<\/p>\n<\/td>\n<td align=\"center\">\n<p>22<\/p>\n<\/td>\n<td>\n<p>IR_BUTTON_0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">\n<p>A<\/p>\n<\/td>\n<td align=\"center\">\n<p>69<\/p>\n<\/td>\n<td>\n<p>IR_BUTTON_A v\u00f5i IR_BUTTON_POWER<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">\n<p>B<\/p>\n<\/td>\n<td align=\"center\">\n<p>70<\/p>\n<\/td>\n<td>\n<p>IR_BUTTON_B<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">\n<p>C<\/p>\n<\/td>\n<td align=\"center\">\n<p>71<\/p>\n<\/td>\n<td>\n<p>IR_BUTTON_C v\u00f5i IR_BUTTON_MENU<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">\n<p>D<\/p>\n<\/td>\n<td align=\"center\">\n<p>68<\/p>\n<\/td>\n<td>\n<p>IR_BUTTON_D v\u00f5i IR_BUTTON_TEST<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">\n<p>E<\/p>\n<\/td>\n<td align=\"center\">\n<p>67<\/p>\n<\/td>\n<td>\n<p>IR_BUTTON_E v\u00f5i IR_BUTTON_RETURN<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">\n<p>\u00dcLES<\/p>\n<\/td>\n<td align=\"center\">\n<p>64<\/p>\n<\/td>\n<td>\n<p>IR_BUTTON_UP v\u00f5i IR_BUTTON_PLUS<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">\n<p>ALLA<\/p>\n<\/td>\n<td align=\"center\">\n<p>25<\/p>\n<\/td>\n<td>\n<p>IR_BUTTON_DOWN v\u00f5i IR_BUTTON_MINUS<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">\n<p>VASAKULE<\/p>\n<\/td>\n<td align=\"center\">\n<p>7<\/p>\n<\/td>\n<td>\n<p>IR_BUTTON_LEFT v\u00f5i IR_BUTTON_PREVIOUS<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">\n<p>PAREMALE<\/p>\n<\/td>\n<td align=\"center\">\n<p>9<\/p>\n<\/td>\n<td>\n<p>IR_BUTTON_RIGHT v\u00f5i IR_BUTTON_NEXT<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">\n<p>HAMMASRATAS<\/p>\n<\/td>\n<td align=\"center\">\n<p>21<\/p>\n<\/td>\n<td>\n<p>IR_BUTTON_SETTING v\u00f5i IR_BUTTON_PLAY<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Kui oled k\u00f5ik andurid l\u00e4bi uurinud, liigu edasi enesetesti juurde.\u00a0<\/p>\n","protected":false},"excerpt":{"rendered":"<p>mBot-i peal olevad andurid hakkavad otsa saama. Viimane, mis j\u00e4\u00e4nud, on IR-vastuv\u00f5tja. Sellest videost n\u00e4edki, kuidas seda kasutada ja mis \u00fclesandeid sellega t\u00e4idetakse. Samuti saad teada, mis tingimustel IR-vastuv\u00f5tjat on m\u00f5istlik anduriks lugeda. Kolmandate osapoolte sisu n\u00e4gemiseks palun n\u00f5ustu k\u00fcpsistega. &#8230;<\/p>\n","protected":false},"author":98,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"class_list":["post-22","page","type-page","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/sisu.ut.ee\/robot\/wp-json\/wp\/v2\/pages\/22","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sisu.ut.ee\/robot\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/sisu.ut.ee\/robot\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/sisu.ut.ee\/robot\/wp-json\/wp\/v2\/users\/98"}],"replies":[{"embeddable":true,"href":"https:\/\/sisu.ut.ee\/robot\/wp-json\/wp\/v2\/comments?post=22"}],"version-history":[{"count":1,"href":"https:\/\/sisu.ut.ee\/robot\/wp-json\/wp\/v2\/pages\/22\/revisions"}],"predecessor-version":[{"id":89,"href":"https:\/\/sisu.ut.ee\/robot\/wp-json\/wp\/v2\/pages\/22\/revisions\/89"}],"wp:attachment":[{"href":"https:\/\/sisu.ut.ee\/robot\/wp-json\/wp\/v2\/media?parent=22"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}