{"id":1437,"date":"2019-08-11T16:35:22","date_gmt":"2019-08-11T16:35:22","guid":{"rendered":"https:\/\/thezhut.com\/?page_id=1437"},"modified":"2019-08-11T16:39:16","modified_gmt":"2019-08-11T16:39:16","slug":"how-to-make-two-arduino-boards-talk-to-each-other","status":"publish","type":"page","link":"https:\/\/thezhut.com\/?page_id=1437","title":{"rendered":"How to make two Arduino boards talk to each other"},"content":{"rendered":"<h1>Today we will take a look at how to use serial communication to make to Arduino boards communicate with each other.<\/h1>\n<p>&nbsp;<\/p>\n<p><iframe loading=\"lazy\" title=\"How to make two Arduino boards talk to each other.\" width=\"640\" height=\"360\" src=\"https:\/\/www.youtube.com\/embed\/E-9_5vwxGUk?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><span style=\"color: #ff0000;\"><strong>SCHEMATICS:<\/strong><\/span><\/h1>\n<h1><\/h1>\n<h1><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1438\" src=\"https:\/\/thezhut.com\/wp-content\/uploads\/2019\/08\/serial_4-300x192.jpg\" alt=\"\" width=\"641\" height=\"410\" srcset=\"https:\/\/thezhut.com\/wp-content\/uploads\/2019\/08\/serial_4-300x192.jpg 300w, https:\/\/thezhut.com\/wp-content\/uploads\/2019\/08\/serial_4-768x492.jpg 768w, https:\/\/thezhut.com\/wp-content\/uploads\/2019\/08\/serial_4-1024x656.jpg 1024w, https:\/\/thezhut.com\/wp-content\/uploads\/2019\/08\/serial_4.jpg 1494w\" sizes=\"auto, (max-width: 641px) 100vw, 641px\" \/><\/h1>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1440\" src=\"https:\/\/thezhut.com\/wp-content\/uploads\/2019\/08\/serial_logic_lvl_converter-300x169.jpg\" alt=\"\" width=\"639\" height=\"360\" srcset=\"https:\/\/thezhut.com\/wp-content\/uploads\/2019\/08\/serial_logic_lvl_converter-300x169.jpg 300w, https:\/\/thezhut.com\/wp-content\/uploads\/2019\/08\/serial_logic_lvl_converter-768x434.jpg 768w, https:\/\/thezhut.com\/wp-content\/uploads\/2019\/08\/serial_logic_lvl_converter-1024x578.jpg 1024w, https:\/\/thezhut.com\/wp-content\/uploads\/2019\/08\/serial_logic_lvl_converter.jpg 1695w\" sizes=\"auto, (max-width: 639px) 100vw, 639px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1441\" src=\"https:\/\/thezhut.com\/wp-content\/uploads\/2019\/08\/serial_voltage_divider-300x167.jpg\" alt=\"\" width=\"638\" height=\"355\" srcset=\"https:\/\/thezhut.com\/wp-content\/uploads\/2019\/08\/serial_voltage_divider-300x167.jpg 300w, https:\/\/thezhut.com\/wp-content\/uploads\/2019\/08\/serial_voltage_divider-768x428.jpg 768w, https:\/\/thezhut.com\/wp-content\/uploads\/2019\/08\/serial_voltage_divider-1024x570.jpg 1024w, https:\/\/thezhut.com\/wp-content\/uploads\/2019\/08\/serial_voltage_divider.jpg 1551w\" sizes=\"auto, (max-width: 638px) 100vw, 638px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1442\" src=\"https:\/\/thezhut.com\/wp-content\/uploads\/2019\/08\/skematic-264x300.jpg\" alt=\"\" width=\"637\" height=\"723\" srcset=\"https:\/\/thezhut.com\/wp-content\/uploads\/2019\/08\/skematic-264x300.jpg 264w, https:\/\/thezhut.com\/wp-content\/uploads\/2019\/08\/skematic-768x871.jpg 768w, https:\/\/thezhut.com\/wp-content\/uploads\/2019\/08\/skematic-903x1024.jpg 903w, https:\/\/thezhut.com\/wp-content\/uploads\/2019\/08\/skematic.jpg 1404w\" sizes=\"auto, (max-width: 637px) 100vw, 637px\" \/><\/p>\n<h1><span style=\"color: #ff0000;\">ARDUINO TRANSMITER CODE:<\/span><\/h1>\n<p>&nbsp;<\/p>\n<p>#define button 2<\/p>\n<p>void setup() {<br \/>\nSerial.begin(9600);<br \/>\npinMode(button, INPUT_PULLUP);<\/p>\n<p>}<\/p>\n<p>void loop() {<\/p>\n<p>if (digitalRead(button) == LOW)<br \/>\n{<br \/>\nSerial.write(100);<br \/>\ndelay(500);<br \/>\n}<br \/>\ndelay(100);<br \/>\n}<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h1><span style=\"color: #ff0000;\">RECIEVER ARDUINO CODE:<\/span><\/h1>\n<p>&nbsp;<\/p>\n<p>#define led 13<br \/>\nint val;<br \/>\nboolean state = false;<br \/>\nvoid setup() {<br \/>\nSerial.begin(9600);<br \/>\npinMode(led, OUTPUT);<br \/>\ndigitalWrite(led, LOW);<\/p>\n<p>}<\/p>\n<p>void loop() {<br \/>\nif (Serial.available() &gt; 0)<br \/>\n{<br \/>\nval = Serial.read();<\/p>\n<p>if (val == 100 &amp;&amp; state == false)<br \/>\n{<br \/>\ndigitalWrite(led, HIGH);<br \/>\nstate = true;<br \/>\ndelay(250);<br \/>\n}<br \/>\nelse if (val == 100 &amp;&amp; state == true)<br \/>\n{<br \/>\ndigitalWrite(led,LOW);<br \/>\nstate = false;<br \/>\ndelay(250);<br \/>\n}<br \/>\n}<br \/>\n}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today we will take a look at how to use serial communication to make to Arduino boards communicate with each other. &nbsp; &nbsp; SCHEMATICS: ARDUINO TRANSMITER CODE: &nbsp; #define button 2 void setup() { Serial.begin(9600); pinMode(button, INPUT_PULLUP); } void loop() &hellip; <a href=\"https:\/\/thezhut.com\/?page_id=1437\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":1382,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_monsterinsights_skip_tracking":false,"footnotes":"","_links_to":"","_links_to_target":""},"class_list":["post-1437","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/thezhut.com\/index.php?rest_route=\/wp\/v2\/pages\/1437","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\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thezhut.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1437"}],"version-history":[{"count":1,"href":"https:\/\/thezhut.com\/index.php?rest_route=\/wp\/v2\/pages\/1437\/revisions"}],"predecessor-version":[{"id":1443,"href":"https:\/\/thezhut.com\/index.php?rest_route=\/wp\/v2\/pages\/1437\/revisions\/1443"}],"up":[{"embeddable":true,"href":"https:\/\/thezhut.com\/index.php?rest_route=\/wp\/v2\/pages\/1382"}],"wp:attachment":[{"href":"https:\/\/thezhut.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1437"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}