{"id":2937,"date":"2021-12-17T07:51:54","date_gmt":"2021-12-17T15:51:54","guid":{"rendered":"https:\/\/www.donluc.com\/?p=2937"},"modified":"2021-12-17T07:51:54","modified_gmt":"2021-12-17T15:51:54","slug":"project-12-robotics-transmitter-and-receiver-mk14","status":"publish","type":"post","link":"https:\/\/www.donluc.com\/?p=2937","title":{"rendered":"Project #12: Robotics &#8211; Transmitter and Receiver &#8211; Mk14"},"content":{"rendered":"<div style=\"width: 720px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-2937-1\" width=\"720\" height=\"480\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/12\/DL2112Mk04W.mp4?_=1\" \/><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/12\/DL2112Mk04W.mp4\">https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/12\/DL2112Mk04W.mp4<\/a><\/video><\/div>\n<p>&#8212;&#8212;<\/p>\n<p>#DonLucElectronics #DonLuc #Robotics #Arduino #Fio #XBee #XBeeS1 #Transmitter #Project #Fritzing #Programming #Electronics #Microcontrollers #Consultant<\/p>\n<p>&#8212;&#8212;<\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/12\/DL2112Mk04a.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/12\/DL2112Mk04a.png\" alt=\"Transmitter and Receiver\" width=\"720\" height=\"525\" class=\"alignnone size-full wp-image-2939\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/12\/DL2112Mk04a.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/12\/DL2112Mk04a-300x219.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/12\/DL2112Mk04b.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/12\/DL2112Mk04b.png\" alt=\"Transmitter and Receiver\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-2940\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/12\/DL2112Mk04b.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/12\/DL2112Mk04b-300x200.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/12\/DL2112Mk04c.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/12\/DL2112Mk04c.png\" alt=\"Transmitter and Receiver\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-2941\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/12\/DL2112Mk04c.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/12\/DL2112Mk04c-300x200.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><strong>Serial<\/strong><\/p>\n<p>Used for communication between the Arduino board and a computer or other devices. All Arduino boards have at least one serial port, and some have several. Fio v3 ATmega32U4 board, Serial1 pins, 0(RX), 1(TX). On Fio v3 ATmega32U4, pins 0 and 1 are used for communication with the computer. Connecting anything to these pins can interfere with that communication, including causing failed uploads to the board. You can use the Arduino environment\u2019s built-in serial monitor to communicate with an Arduino board. Click the serial monitor button in the toolbar and select the same baud rate used in the call to begin(). Serial communication on pins TX\/RX uses TTL logic levels 3.3V . Don\u2019t connect these pins directly to an RS232 serial port, they operate at +\/- 12V and can damage your Arduino board.<\/p>\n<p><strong>DL2112Mk04<\/strong><\/p>\n<p>2 x Fio v3 &#8211; ATmega32U4<br \/>\n2 x XBee S1<br \/>\n2 x Lithium Ion Battery &#8211; 850mAh<br \/>\n1 x Thumb Joystick<br \/>\n1 x SparkFun Thumb Joystick Breakout<br \/>\n1 x Slide Pot (Small)<br \/>\n1 x Slide Potentiometer Knob<br \/>\n1 x LED Green<br \/>\n1 x Half-Size Breadboard<br \/>\n1 x SparkFun Cerberus USB Cable<\/p>\n<p><strong>Fio v3 &#8211; ATmega32U4 &#8211; Transmitter<\/strong><\/p>\n<p><strong>XBee S1:<\/strong> Transmitter<\/p>\n<p><strong>CH Channel:<\/strong> C<br \/>\n<strong>PAN Id:<\/strong> 3333<br \/>\n<strong>SH Serial Number:<\/strong> 13A200<br \/>\n<strong>SL Serial Number:<\/strong> 40717A1F<br \/>\n<strong>CE Coordinator:<\/strong> Coordinator<br \/>\n<strong>BD:<\/strong> 9600<\/p>\n<p>RX0 &#8211; Digital 0<br \/>\nTX0 &#8211; Digital 1<br \/>\nPO0 &#8211; Analog A0<br \/>\nJY0 &#8211; Analog A1<br \/>\nJY1 &#8211; Analog A2<br \/>\nSE0 &#8211; Digital 16<br \/>\nVIN &#8211; +3.3V<br \/>\nGND &#8211; GND<\/p>\n<p><strong>DL2112Mk04t.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/* ***** Don Luc Electronics \u00a9 *****\r\nSoftware Version Information\r\nProject #12: Robotics - XBee S1 - Transmitter - Mk14\r\n12-04\r\nDL2112Mk04t.ino\r\n1 x Fio v3 - ATmega32U4\r\n1 x XBee S1\r\n1 x Lithium Ion Battery - 850mAh\r\n1 x Thumb Joystick\r\n1 x SparkFun Thumb Joystick Breakout\r\n1 x Slide Pot (Small)\r\n1 x Slide Potentiometer Knob\r\n1 x SparkFun Cerberus USB Cable\r\n*\/\r\n\r\n\/\/ Include the Library Code\r\n\/\/ EEPROM library to read and write EEPROM with unique ID for unit\r\n#include &lt;EEPROM.h&gt;\r\n\r\n\/\/ Communication\r\nunsigned long dTime = 50;\r\n\r\n\/\/ Slide Pot (Small)\r\n\/\/ Select the input pin for the slide pot\r\n\/\/ Power\r\nconst int iSP1 = A0;\r\n\/\/ Power to store the value\r\nint iPower = 0;\r\n\r\n\/\/ Connections to joystick\r\n\/\/ Vertical\r\nconst int VERT = A1;\r\n\/\/ Horizontal\r\nconst int HORIZ = A2;\r\n\/\/ Pushbutton\r\nconst int SEL = 16;\r\n\/\/ Initialize variables for analog and digital values\r\nint vertical;\r\nint horizontal;\r\nint select;\r\n\r\n\/\/ Software Version Information\r\n\/\/ Version\r\nString sver = &quot;12-14t&quot;;\r\n\/\/ Unit ID Information\r\n\/\/ UID\r\nString uid = &quot;&quot;;\r\n\r\nvoid loop()\r\n{\r\n\r\n  \/\/ Thumb Joystick\r\n  isThumbJoystick();\r\n    \r\n  \/\/ Process Message\r\n  isProcessMessage();\r\n\r\n  delay( dTime );\r\n  \r\n}\r\n<\/pre>\n<p><strong>getEEPROM.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ EEPROM\r\n\/\/ is UID\r\nvoid isUID()\r\n{\r\n  \r\n  \/\/ Is Unit ID\r\n  \/\/ UID\r\n  uid = &quot;&quot;;\r\n  for (int x = 0; x &lt; 5; x++)\r\n  {\r\n    uid = uid + char(EEPROM.read(x));\r\n  }\r\n  \r\n}\r\n<\/pre>\n<p><strong>getProcessMessage.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ Process Message\r\n\/\/ isProcessMessage\r\nvoid isProcessMessage() {\r\n  \r\n   \/\/ Loop through serial buffer\r\n   \/\/ Print = &quot;&lt;&quot; + vertical + &quot;|&quot; + horizontal + &quot;|&quot; + select + &quot;|&quot; + iValue + &quot;|&quot; + sver + &quot;|&quot; + uid + &quot;*&quot;\r\n      \r\n   Serial1.print( &#039;&lt;&#039;  );\r\n   Serial1.print( vertical );\r\n   Serial1.print( &#039;|&#039; );\r\n   Serial1.print( horizontal );\r\n   Serial1.print( &#039;|&#039; );\r\n   Serial1.print( select );\r\n   Serial1.print( &#039;|&#039; );\r\n   Serial1.print( iPower );\r\n   Serial1.print( &#039;|&#039; );\r\n   Serial1.print( sver );\r\n   Serial1.print( &#039;|&#039; );\r\n   Serial1.print( uid );\r\n   Serial1.println( &#039;*&#039; );\r\n\r\n}\r\n<\/pre>\n<p><strong>getThumbJoystick.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ Thumb Joystick\r\nvoid isThumbJoystick() {\r\n\r\n  \/\/ Read all values from the joystick\r\n  \/\/ Joystick was sitting around 520 for the vertical and horizontal values\r\n  \/\/ Will be 0-1023\r\n  vertical = analogRead(VERT);\r\n  \/\/ Will be 0-1023\r\n  horizontal = analogRead(HORIZ);\r\n  \/\/ Will be HIGH (1) if not pressed, and LOW (0) if pressed\r\n  select = digitalRead(SEL);\r\n  \/\/ Read the value\r\n  \/\/ Power be 0-1023\r\n  iPower = analogRead( iSP1 );\r\n \r\n}\r\n<\/pre>\n<p><strong>setup.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ Setup\r\nvoid setup()\r\n{\r\n\r\n  \/\/ EEPROM Unit ID\r\n  isUID();\r\n  \r\n  \/\/ Pause\r\n  delay(5);\r\n  \r\n  \/\/ Make the SEL line an input\r\n  pinMode(SEL, INPUT_PULLUP);\r\n  \r\n  \/\/ Open Serial1 port at 9600 baud\r\n  Serial1.begin( 9600 );\r\n\r\n  \/\/ Pause\r\n  delay(5);\r\n\r\n}\r\n<\/pre>\n<p>&#8212;&#8212;<\/p>\n<p><strong>Fio v3 &#8211; ATmega32U4 &#8211; Receiver<\/strong><\/p>\n<p><strong>XBee S1:<\/strong> Receiver<\/p>\n<p><strong>CH Channel:<\/strong> C<br \/>\n<strong>PAN Id:<\/strong> 3333<br \/>\n<strong>SH Serial Number:<\/strong> 13A200<br \/>\n<strong>SL Serial Number:<\/strong> 4076E2C5<br \/>\n<strong>CE Coordinator:<\/strong> End Device<br \/>\n<strong>BD:<\/strong> 9600<\/p>\n<p>RX0 &#8211; Digital 0<br \/>\nTX0 &#8211; Digital 1<br \/>\nLED &#8211; Digital 6<br \/>\nVIN &#8211; +3.3V<br \/>\nGND &#8211; GND<\/p>\n<p><strong>DL2112Mk04r.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/* ***** Don Luc Electronics \u00a9 *****\r\nSoftware Version Information\r\nProject #12: Robotics - Receiver - Mk14\r\n12-04\r\nDL2112Mk04r.ino\r\n1 x Fio v3 - ATmega32U4\r\n1 x XBee S1\r\n1 x Lithium Ion Battery - 850mAh\r\n1 x LED Green\r\n1 x Half-Size Breadboard\r\n1 x SparkFun Cerberus USB Cable\r\n*\/\r\n\r\n\/\/ Include the library code:\r\n\/\/ EEPROM library to read and write EEPROM with unique ID for unit\r\n#include &lt;EEPROM.h&gt;\r\n\r\n\/\/ LED Green\r\nint iLEDGreen = 6;\r\n\r\n\/\/ Process Message\r\n\/\/ Start\r\nbool bStart = false;\r\n\/\/ End\r\nbool bEnd   = false;\r\n\/\/ Variable to store the incoming byte\r\nint incb = 0;\r\n\/\/ Message\r\nString msg = &quot;&quot;;\r\n\/\/ Index\r\nbyte in = 0;\r\nint x = 0;\r\n\r\n\/\/ Software Version Information\r\nString sver = &quot;12-14r&quot;;\r\n\/\/ Unit ID information\r\nString uid = &quot;&quot;;\r\n\r\nvoid loop() {\r\n\r\n  \/\/ Check for serial messages\r\n  isProcessMessage();\r\n\r\n}\r\n<\/pre>\n<p><strong>getEEPROM.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ EEPROM\r\n\/\/ isUID\r\nvoid isUID()\r\n{\r\n  \r\n  \/\/ Is Unit ID\r\n  uid = &quot;&quot;;\r\n  for (int x = 0; x &lt; 5; x++)\r\n  {\r\n    uid = uid + char(EEPROM.read(x));\r\n  }\r\n  \r\n}\r\n<\/pre>\n<p><strong>getProcessMessage.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ ProcessMessage\r\n\/\/ isProcessMessage\r\nvoid isProcessMessage() {\r\n   \r\n  \/\/ Loop through serial buffer one byte at a time until you reach * which will be end of message\r\n  while ( Serial1.available() &gt; 0 ) \r\n  {\r\n      \r\n      \/\/ Read the incoming byte:\r\n      incb = Serial1.read();\r\n      \r\n      \/\/ Start the message when the &#039;&lt;&#039; symbol is received\r\n      if(incb == &#039;&lt;&#039;)\r\n      {\r\n        \r\n        bStart = true;\r\n        in = 0;\r\n        msg = &quot;&quot;;\r\n        \/\/ Done reading\r\n        \r\n      }\r\n      \/\/ End the message when the &#039;*&#039; symbol is received\r\n      else if(incb == &#039;*&#039;)\r\n      {\r\n        \r\n        bEnd = true;\r\n        x = msg.length();\r\n        msg.remove( x , 1);\r\n        \/\/ Done reading\r\n        \r\n        break;\r\n      }\r\n      \/\/ Read the message\r\n      else\r\n      {\r\n        \r\n        msg = msg + char(incb);\r\n        in++;\r\n\r\n      }\r\n      \r\n   }\r\n\r\n   \/\/ Start - End\r\n   if( bStart &amp;&amp; bEnd)\r\n   {\r\n    \r\n      digitalWrite(iLEDGreen, HIGH);\r\n      in = 0;\r\n      msg = &quot;&quot;;\r\n      bStart = false;\r\n      bEnd = false;\r\n      \r\n   }\r\n\r\n}\r\n<\/pre>\n<p><strong>setup.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ Setup\r\nvoid setup() {\r\n\r\n  \/\/ Open the serial port at 9600 bps:\r\n  Serial1.begin( 9600 );\r\n\r\n  \/\/ Pause\r\n  delay(5);\r\n\r\n  \/\/ EEPROM Unit ID\r\n  isUID();\r\n  \r\n  \/\/ Pause\r\n  delay(5);\r\n  \r\n  \/\/ LED Green\r\n  pinMode(iLEDGreen, OUTPUT);\r\n  digitalWrite(iLEDGreen, LOW);\r\n\r\n}\r\n<\/pre>\n<p>&#8212;&#8212;<\/p>\n<p><strong>People can contact us:<\/strong> https:\/\/www.donluc.com\/?page_id=1927<\/p>\n<p><strong>Technology Experience<\/strong><\/p>\n<ul>\n<li>Single-Board Microcontrollers (PIC, Arduino, Raspberry Pi,Espressif, etc&#8230;)<\/li>\n<li>IoT<\/li>\n<li>Robotics<\/li>\n<li>Camera and Video Capture Receiver Stationary, Wheel\/Tank and Underwater Vehicle<\/li>\n<li>Unmanned Vehicles Terrestrial and Marine<\/li>\n<li>Research &#038; Development (R &#038; D)<\/li>\n<li>Desktop Applications (Windows, OSX, Linux, Multi-OS, Multi-Tier, etc&#8230;)<\/li>\n<li>Mobile Applications (Android, iOS, Blackberry, Windows Mobile, Windows CE, etc&#8230;)<\/li>\n<li>Web Applications (LAMP, Scripting, Java, ASP, ASP.NET, RoR, Wakanda, etc&#8230;)<\/li>\n<li>Social Media Programming &#038; Integration (Facebook, Twitter, YouTube, Pinterest, etc&#8230;)<\/li>\n<li>Content Management Systems (WordPress, Drupal, Joomla, Moodle, etc&#8230;)<\/li>\n<li>Bulletin Boards (phpBB, SMF, Vanilla, jobberBase, etc&#8230;)<\/li>\n<li>eCommerce (WooCommerce, OSCommerce, ZenCart, PayPal Shopping Cart, etc&#8230;)<\/li>\n<\/ul>\n<p><strong>Instructor and E-Mentor<\/strong><\/p>\n<ul>\n<li>IoT<\/li>\n<li>PIC Microcontrollers<\/li>\n<li>Arduino<\/li>\n<li>Raspberry Pi<\/li>\n<li>Espressif<\/li>\n<li>Robotics<\/li>\n<li>DOS, Windows, OSX, Linux, iOS, Android, Multi-OS<\/li>\n<li>Linux-Apache-PHP-MySQL<\/li>\n<\/ul>\n<p><strong>Follow Us<\/strong><\/p>\n<p><strong>J. Luc Paquin \u2013 Curriculum Vitae &#8211; 2021 English &#038; Espa\u00f1ol<\/strong><br \/>\nhttps:\/\/www.jlpconsultants.com\/luc\/<\/p>\n<p><strong>Web:<\/strong> https:\/\/www.donluc.com\/<br \/>\n<strong>Web:<\/strong> https:\/\/www.jlpconsultants.com\/<br \/>\n<strong>Facebook:<\/strong> https:\/\/www.facebook.com\/neosteam.labs.9\/<br \/>\n<strong>YouTube:<\/strong> https:\/\/www.youtube.com\/channel\/UC5eRjrGn1CqkkGfZy0jxEdA<br \/>\n<strong>Twitter:<\/strong> https:\/\/twitter.com\/labs_steam<br \/>\n<strong>Pinterest:<\/strong> https:\/\/www.pinterest.com\/NeoSteamLabs\/<br \/>\n<strong>Instagram:<\/strong> https:\/\/www.instagram.com\/neosteamlabs\/<\/p>\n<p><strong>Don Luc<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8212;&#8212; #DonLucElectronics #DonLuc #Robotics #Arduino #Fio #XBee #XBeeS1 #Transmitter #Project #Fritzing #Programming #Electronics #Microcontrollers #Consultant &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; Serial Used for communication between the Arduino board and a computer or other devices. All Arduino boards have at least one serial port, and some have several. Fio v3 ATmega32U4 board, Serial1 pins, 0(RX), 1(TX). On &#8230; <a title=\"Project #12: Robotics &#8211; Transmitter and Receiver &#8211; Mk14\" class=\"read-more\" href=\"https:\/\/www.donluc.com\/?p=2937\" aria-label=\"Read more about Project #12: Robotics &#8211; Transmitter and Receiver &#8211; Mk14\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[94,50,38,59,5,58,10,43,57],"tags":[6,92,102,4,19,85,24,9,27,95,109,96,33,195,100],"class_list":["post-2937","post","type-post","status-publish","format-standard","hentry","category-robotics-projerts","category-arduino","category-digitalelectronics","category-fritzing","category-microcontrollers","category-arduino-programming","category-projects","category-sparkfun","category-steren","tag-arduino","tag-battery","tag-components","tag-consultant","tag-electronics","tag-fritzing","tag-microcontroller","tag-programming","tag-projects-2","tag-robotic","tag-sparkfun","tag-stepper","tag-technology","tag-transmitter-and-receiver","tag-xbee"],"_links":{"self":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/2937","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2937"}],"version-history":[{"count":2,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/2937\/revisions"}],"predecessor-version":[{"id":4311,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/2937\/revisions\/4311"}],"wp:attachment":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2937"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2937"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2937"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}