{"id":1066,"date":"2018-10-31T19:03:28","date_gmt":"2018-10-31T19:03:28","guid":{"rendered":"https:\/\/zhutarduino.wordpress.com\/?page_id=1066"},"modified":"2019-10-20T16:38:17","modified_gmt":"2019-10-20T16:38:17","slug":"arduino-sensors-infrared-receiver","status":"publish","type":"page","link":"https:\/\/thezhut.com\/?page_id=1066","title":{"rendered":"Arduino sensors: Infrared receiver"},"content":{"rendered":"<h1 style=\"text-align: center;\">In this lesson we will take a look at how to setup and use an infrared receiver with your Arduino board.<\/h1>\n<p><iframe loading=\"lazy\" title=\"Arduino sensors: Infrared receiver\" width=\"640\" height=\"360\" src=\"https:\/\/www.youtube.com\/embed\/MER1297AS18?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n<p>&nbsp;<\/p>\n<h1><a href=\"https:\/\/www.facebook.com\/zarduino\/\" target=\"_blank\" rel=\"noopener noreferrer\">Check us out on Facebook!<\/a><\/h1>\n<h1>Parts List:<\/h1>\n<p>affiliate links<\/p>\n<p><a href=\"https:\/\/www.amazon.com\/gp\/search\/ref=as_li_qf_sp_sr_il_tl?ie=UTF8&amp;tag=zhut01-20&amp;keywords=arduino IR Receiver&amp;index=aps&amp;camp=1789&amp;creative=9325&amp;linkCode=xm2&amp;linkId=fde0c1733fc5dd22a8b941f1100f203c\" target=\"_blank\" rel=\"noopener noreferrer\">IR Receiver<\/a><\/p>\n<p>&nbsp;<\/p>\n<h1>ARDUINO Code:<\/h1>\n<p>#include &lt;IRremote.h&gt;<br \/>\nint RECV_PIN = 11;<br \/>\nIRrecv irrecv(RECV_PIN);<br \/>\ndecode_results results;<br \/>\n#define led 13<br \/>\nboolean state = false;<br \/>\nvoid setup() {<br \/>\n\/\/Serial.begin(9600);<br \/>\nirrecv.enableIRIn(); \/\/ Start the receiver<br \/>\npinMode(led, OUTPUT);<br \/>\n}<\/p>\n<p>void loop() {<br \/>\nif (irrecv.decode(&amp;results)) {<br \/>\n\/\/Serial.println(results.value);<br \/>\n\/\/delay(100);<br \/>\nirrecv.resume(); \/\/ Receive the next value<br \/>\nif (results.value == 1320368837 &amp;&amp; state == false) \/\/ put your remote number here<br \/>\n{<br \/>\ndigitalWrite(led, HIGH);<br \/>\nstate = true;<br \/>\ndelay(10);<br \/>\n}<br \/>\nelse if (results.value == 1320368837 &amp;&amp; state == true) \/\/ put your remote number here<br \/>\n{<br \/>\ndigitalWrite(led, LOW);<br \/>\nstate = false;<br \/>\ndelay(10);<br \/>\n}<br \/>\n}<br \/>\n}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this lesson we will take a look at how to setup and use an infrared receiver with your Arduino board. &nbsp; Check us out on Facebook! Parts List: affiliate links IR Receiver &nbsp; ARDUINO Code: #include &lt;IRremote.h&gt; int RECV_PIN &hellip; <a href=\"https:\/\/thezhut.com\/?page_id=1066\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"parent":1063,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":"","_links_to":"","_links_to_target":""},"class_list":["post-1066","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/thezhut.com\/index.php?rest_route=\/wp\/v2\/pages\/1066","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thezhut.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/thezhut.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/thezhut.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/thezhut.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1066"}],"version-history":[{"count":1,"href":"https:\/\/thezhut.com\/index.php?rest_route=\/wp\/v2\/pages\/1066\/revisions"}],"predecessor-version":[{"id":1467,"href":"https:\/\/thezhut.com\/index.php?rest_route=\/wp\/v2\/pages\/1066\/revisions\/1467"}],"up":[{"embeddable":true,"href":"https:\/\/thezhut.com\/index.php?rest_route=\/wp\/v2\/pages\/1063"}],"wp:attachment":[{"href":"https:\/\/thezhut.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1066"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}