{"id":2970,"date":"2022-01-22T06:12:09","date_gmt":"2022-01-22T14:12:09","guid":{"rendered":"https:\/\/www.donluc.com\/?p=2970"},"modified":"2022-01-22T06:12:09","modified_gmt":"2022-01-22T14:12:09","slug":"project-12-robotics-lipower-boost-converter-mk19","status":"publish","type":"post","link":"https:\/\/www.donluc.com\/?p=2970","title":{"rendered":"Project #12: Robotics &#8211; LiPower Boost Converter &#8211; Mk19"},"content":{"rendered":"<div style=\"width: 720px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-2970-1\" width=\"720\" height=\"480\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/01\/DL2201Mk03W.mp4?_=1\" \/><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/01\/DL2201Mk03W.mp4\">https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/01\/DL2201Mk03W.mp4<\/a><\/video><\/div>\n<p>&#8212;&#8212;<\/p>\n<p>#DonLucElectronics #DonLuc #Robotics #Arduino #Fio #ArduinoProMini #XBee #DCMotor #MotorDriver #Project #Fritzing #Programming #Electronics #Microcontrollers #Consultant<\/p>\n<p>&#8212;&#8212;<\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/01\/DL2201Mk03a.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/01\/DL2201Mk03a.png\" alt=\"LiPower Boost Converter\" width=\"720\" height=\"694\" class=\"alignnone size-full wp-image-2972\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/01\/DL2201Mk03a.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/01\/DL2201Mk03a-300x289.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\/2022\/01\/DL2201Mk03b.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/01\/DL2201Mk03b.png\" alt=\"LiPower Boost Converter\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-2973\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/01\/DL2201Mk03b.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/01\/DL2201Mk03b-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\/2022\/01\/DL2201Mk03c.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/01\/DL2201Mk03c.png\" alt=\"LiPower Boost Converter\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-2974\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/01\/DL2201Mk03c.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/01\/DL2201Mk03c-300x200.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><strong>LiPower Boost Converter<\/strong><\/p>\n<p>The LiPower board is based on the incredibly versatile TPS61200 boost converter. The board is configured to be used with a LiPo battery, has solder jumper selectable 5V and 3.3V output, and an under voltage protection of 2.6V. However, the board can also be used as a general purpose buck and boost regulator with an input voltage as low as 0.3V. With such a low input voltage and quiescent current, the board also works well in energy harvesting applications that use low input voltages.<\/p>\n<p><strong>XBee Explorer Regulated<\/strong><\/p>\n<p>The XBee Explorer Regulated takes care of the 3.3V regulation, signal conditioning, and basic activity indicators. It translates the 5V serial signals to 3.3V so that you can connect a 5V system to any XBee module. The board was conveniently designed to mate directly with Arduino Pro boards for wireless bootloading and USB based configuration. This unit works with all XBee modules including the Series 1 and Series 2.5, standard and Pro versions. Plug an XBee into this breakout and you will have direct access to the serial and programming pins on the XBee unit and will be able to power the XBee with 5V.<\/p>\n<p><strong>DL2201Mk03<\/strong><\/p>\n<p>1 x Fio v3 &#8211; ATmega32U4<br \/>\n1 x Arduino Pro Mini 328 &#8211; 5V\/16MHz<br \/>\n1 x SparkFun FTDI Basic Breakout &#8211; 5V<br \/>\n1 x LiPower Boost Converter<br \/>\n2 x XBee S1<br \/>\n1 x XBee Explorer Regulated<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 RGB Smart NeoPixel<br \/>\n2 x DRV8835 Dual Motor Driver Carrier<br \/>\n2 x Solarbotics RM2<br \/>\n2 x Pololu Universal Aluminum Mounting Hub 3mm Shaft, #4-40 Holes<br \/>\n2 x Pololu Mini Plastic Gearmotor Bracket Pair &#8211; Wide<br \/>\n1 x Half-Size Breadboard<br \/>\n2 x Adafruit Perma-Proto Quarter-Sized 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>&#8212;&#8212;<\/p>\n<p><strong>DL2201Mk03t.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 - LiPower Boost Converter - Mk19\r\n01-03\r\nDL2201Mk03t.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 = 200;\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-19t&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>Arduino Pro Mini 328 &#8211; 5V\/16MHz &#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 \/>\nM11 &#8211; Digital 2<br \/>\nM12 &#8211; Digital 3<br \/>\nM21 &#8211; Digital 4<br \/>\nM22 &#8211; Digital 5<br \/>\nNEO &#8211; Digital 6<br \/>\nVIN &#8211; +5V<br \/>\nGND &#8211; GND<\/p>\n<p>&#8212;&#8212;<\/p>\n<p><strong>DL2201Mk03r.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 - LiPower Boost Converter - Mk19\r\n01-03\r\nDL2201Mk03r.ino\r\n1 x Arduino Pro Mini 328 - 5V\/16MHz\r\n1 x SparkFun FTDI Basic Breakout - 5V\r\n1 x XBee S1\r\n1 x XBee Explorer Regulated\r\n1 x LiPower Boost Converter\r\n1 x Lithium Ion Battery - 850mAh\r\n1 x RGB Smart NeoPixel\r\n2 x DRV8835 Dual Motor Driver Carrier\r\n2 x Solarbotics RM2\r\n2 x Pololu Universal Aluminum Mounting Hub 3mm Shaft, #4-40 Holes\r\n2 x Pololu Mini Plastic Gearmotor Bracket Pair - Wide\r\n1 x Half-Size Breadboard\r\n2 x Adafruit Perma-Proto Quarter-Sized 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\/\/ NeoPixels\r\n#include &lt;Adafruit_NeoPixel.h&gt;\r\n\r\n\/\/ Solarbotics RM2 -&gt; 1\r\n#define MOTOR1_IN1 2\r\n#define MOTOR1_IN2 3\r\n\/\/ Solarbotics RM2 -&gt; 2\r\n#define MOTOR2_IN1 4\r\n#define MOTOR2_IN2 5\r\n\r\n\/\/ Power be 0-1023\r\nint iPower = 0;\r\nString POW = &quot;&quot;;\r\n\/\/ Joystick was sitting around 520 for the vertical and horizontal values\r\n\/\/ Will be 0-1023\r\n\/\/ Vertical\r\nint vertical;\r\nString VER = &quot;&quot;;\r\n\/\/ Horizontal\r\n\/\/ Will be 0-1023\r\nint horizontal;\r\nString HOR = &quot;&quot;;\r\n\/\/ Select\r\n\/\/ Will be HIGH (1) if not pressed, and LOW (0) if pressed\r\nint select1 = 0;\r\nString SEL = &quot;&quot;;\r\nint firstClosingBracket = 0;\r\n\/\/ Map Vertical and Horizontal\r\nint mapVer = 0;\r\nint mapHor = 0;\r\nint iVer = 1;\r\nint iHor = 0;\r\n\r\n\/\/ NeoPixels\r\n\/\/ On digital pin 6\r\n#define PIN 6\r\n\/\/ NeoPixels NUMPIXELS = 1\r\n#define NUMPIXELS 1\r\n\/\/ Pixels\r\nAdafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);\r\n\/\/ Red\r\nint red = 0;\r\n\/\/ Green\r\nint green = 0;\r\n\/\/ Blue\r\nint blue = 0;\r\n\/\/ Neopix\r\nint iNeo = 0;\r\n\/\/ Value\r\nint zz = 0;\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-19r&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>getNeopix.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ NeoPixels\r\n\/\/ Neopix\r\nvoid isNeopix() \r\n{ \r\n\r\n    \/\/ Pixels\r\n    pixels.setBrightness( 130 );\r\n    \/\/ Pixels color takes RGB values, from 0,0,0 up to 255,255,255\r\n    pixels.setPixelColor( iNeo, pixels.Color(red,green,blue) ); \r\n    \/\/ This sends the updated pixel color to the hardware\r\n    pixels.show(); \r\n    \/\/ Delay for a period of time (in milliseconds)\r\n    delay(50);     \r\n  \r\n}\r\n\/\/ isNUMPIXELS\r\nvoid isNUMPIXELS()\r\n{\r\n\r\n  \/\/ Neopix Value\r\n  switch ( zz ) {  \r\n    case 0:\r\n      \/\/ NeoPixels Green\r\n      \/\/ Red\r\n      red = 0;\r\n      \/\/ Green\r\n      green = 255;\r\n      \/\/ Blue\r\n      blue = 0;\r\n      \/\/ Neopix\r\n      iNeo = 0;   \r\n      isNeopix();\r\n      break;  \r\n    case 1:\r\n      \/\/ NeoPixels Blue\r\n      \/\/ Red\r\n      red = 0;\r\n      \/\/ Green\r\n      green = 0;\r\n      \/\/ Blue\r\n      blue = 255;\r\n      \/\/ Neopix\r\n      iNeo = 0;\r\n      isNeopix();\r\n      break;\r\n    case 2:\r\n      \/\/ NeoPixels Red\r\n      \/\/ Red\r\n      red = 255;\r\n      \/\/ Green\r\n      green = 0;\r\n      \/\/ Blue\r\n      blue = 0;\r\n      \/\/ Neopix\r\n      iNeo = 0;   \r\n      isNeopix();\r\n      break;\r\n    case 3:\r\n      \/\/ NeoPixels Yellow\r\n      \/\/ Red\r\n      red = 255;\r\n      \/\/ Green\r\n      green = 255;\r\n      \/\/ Blue\r\n      blue = 0;\r\n      \/\/ Neopix\r\n      iNeo = 0;\r\n      isNeopix();\r\n      break;\r\n    case 4:\r\n      \/\/ NeoPixels Magenta\r\n      \/\/ Red\r\n      red = 255;\r\n      \/\/ Green\r\n      green = 0;\r\n      \/\/ Blue\r\n      blue = 255;\r\n      \/\/ Neopix\r\n      iNeo = 0;\r\n      isNeopix();\r\n      break;\r\n    case 5:\r\n      \/\/ NeoPixels Cyan\r\n      \/\/ Red\r\n      red = 0;\r\n      \/\/ Green\r\n      green = 255;\r\n      \/\/ Blue\r\n      blue = 255;\r\n      \/\/ Neopix\r\n      iNeo = 0;\r\n      isNeopix();\r\n      break;\r\n    case 6:\r\n      \/\/ NeoPixels White\r\n      \/\/ Red\r\n      red = 255;\r\n      \/\/ Green\r\n      green = 255;\r\n      \/\/ Blue\r\n      blue = 255;\r\n      \/\/ Neopix\r\n      iNeo = 0;\r\n      isNeopix();    \r\n      break;\r\n  }\r\n  \r\n}\r\n\/\/ isNUMPIXELSoff\r\nvoid isNUMPIXELSoff()\r\n{\r\n\r\n   \/\/ Black Off\r\n   \/\/ NeoPixels\r\n   \/\/ Red\r\n   red = 0;\r\n   \/\/ Green\r\n   green = 0;\r\n   \/\/ Blue\r\n   blue = 0;\r\n   isNeopix();\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 ( Serial.available() &gt; 0 ) \r\n  {\r\n      \r\n      \/\/ Read the incoming byte:\r\n      incb = Serial.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        \/\/ Start\r\n        bStart = true;\r\n        in = 0;\r\n        msg = &quot;&quot;;\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        \/\/ End\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        \/\/ Message\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      \/\/ isRM2Motor =&gt; Message\r\n      isRM2Motor();\r\n      \r\n      \/\/ Start - End\r\n      in = 0;\r\n      msg = &quot;&quot;;\r\n      bStart = false;\r\n      bEnd = false;\r\n      vertical;\r\n      horizontal;\r\n      iPower;\r\n      \r\n   }\r\n\r\n}\r\n<\/pre>\n<p><strong>getRM2Motor.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ RM2 Motor\r\n\/\/ Setup RM2 Motor\r\nvoid isSetupRM2Motor() {\r\n\r\n  \/\/ Solarbotics RM2 -&gt; 1\r\n  pinMode(MOTOR1_IN1, OUTPUT);\r\n  pinMode(MOTOR1_IN2, OUTPUT);\r\n  \/\/ Solarbotics RM2 -&gt; 2\r\n  pinMode(MOTOR2_IN1, OUTPUT);\r\n  pinMode(MOTOR2_IN2, OUTPUT);\r\n  \r\n}\r\n\/\/ isRM2Motor\r\nvoid isRM2Motor() {\r\n\r\n  \/\/ msg = vertical + &quot;|&quot; + horizontal + &quot;|&quot; + select + &quot;|&quot; + iValue + &quot;|&quot; + sver + &quot;|&quot; + uid\r\n  firstClosingBracket = 0;\r\n  \/\/ Vertical\r\n  firstClosingBracket = msg.indexOf(&#039;|&#039;);\r\n  VER = msg;\r\n  VER.remove(firstClosingBracket);\r\n  vertical = VER.toInt();\r\n  \/\/ Horizontal\r\n  firstClosingBracket = firstClosingBracket + 1;\r\n  msg.remove(0, firstClosingBracket );\r\n  firstClosingBracket = msg.indexOf(&#039;|&#039;);\r\n  HOR = msg;\r\n  HOR.remove(firstClosingBracket);\r\n  horizontal = HOR.toInt();\r\n  \/\/ Select\r\n  firstClosingBracket = firstClosingBracket + 1;\r\n  msg.remove(0, firstClosingBracket );  \r\n  firstClosingBracket = msg.indexOf(&#039;|&#039;);\r\n  SEL = msg;\r\n  SEL.remove(firstClosingBracket);\r\n  select1 = SEL.toInt();\r\n  \/\/ Power\r\n  firstClosingBracket = firstClosingBracket + 1;\r\n  msg.remove(0, firstClosingBracket );    \r\n  firstClosingBracket = msg.indexOf(&#039;|&#039;);\r\n  POW = msg;\r\n  POW.remove(firstClosingBracket);\r\n  iPower = POW.toInt();\r\n\r\n  \/\/ Set the direction\r\n  \/\/ Joystick was sitting around 520 for the vertical and horizontal values\r\n  \/\/ Will be 0-1023\r\n  mapVer = map(vertical, 0, 1023, -512, 512);\r\n  mapHor = map(horizontal, 0, 1023, -512, 512);\r\n  \/\/ Power\r\n  iPower = map(iPower, 0, 1023, 30, 200);\r\n\r\n  \/\/ Vertical and Horizontal \r\n  if ( mapVer == -512 ) {\r\n\r\n      \/\/ Down\r\n      \/\/ NeoPixels Blue\r\n      zz = 1;\r\n      isNUMPIXELS();\r\n      iVer = 1;\r\n    \r\n  } else if ( mapVer == 512 ) {\r\n\r\n      \/\/ Up\r\n      \/\/ NeoPixels Green\r\n      zz = 0;\r\n      isNUMPIXELS();\r\n      iVer = 2;\r\n \r\n  } else if ( mapHor == -512 ) {\r\n\r\n      \/\/ Left\r\n      \/\/ NeoPixels Yellow\r\n      zz = 3;\r\n      isNUMPIXELS();\r\n      iVer = 3;\r\n    \r\n  } else if ( mapHor == 512 ) {\r\n\r\n      \/\/ Right\r\n      \/\/ NeoPixels Magenta\r\n      zz = 4;\r\n      isNUMPIXELS();\r\n      iVer = 4;\r\n \r\n  } else {\r\n\r\n    \/\/ Stop\r\n    \/\/ NeoPixels Red\r\n    zz = 2;\r\n    isNUMPIXELS();\r\n    iVer = 5;\r\n    \r\n  }\r\n\r\n  \/\/ XBee Car\r\n  switch ( iVer ) {\r\n    case 1:\r\n\r\n      \/\/ Solarbotics RM2 -&gt; 1 Forward\r\n      digitalWrite(MOTOR1_IN1, LOW);\r\n      analogWrite(MOTOR1_IN2, iPower);\r\n      delay(10);\r\n\r\n      \/\/ Solarbotics RM2 -&gt; 2 Forward\r\n      digitalWrite(MOTOR2_IN1, LOW);\r\n      analogWrite(MOTOR2_IN2, iPower);\r\n      delay(10);\r\n\r\n      break;\r\n    case 2:\r\n\r\n      \/\/ Solarbotics RM2 -&gt; 1 Backward\r\n      digitalWrite(MOTOR1_IN2, LOW);\r\n      analogWrite(MOTOR1_IN1, iPower);\r\n      delay(10);\r\n      \r\n      \/\/ Solarbotics RM2 -&gt; 2 Backward\r\n      digitalWrite(MOTOR2_IN2, LOW);\r\n      analogWrite(MOTOR2_IN1, iPower);\r\n      delay(10);\r\n\r\n      break;\r\n    case 3:\r\n\r\n      \/\/ Right\r\n      \/\/ Solarbotics RM2 -&gt; 1 Forward\r\n      digitalWrite(MOTOR1_IN1, LOW);\r\n      analogWrite(MOTOR1_IN2, iPower);\r\n      delay(10);\r\n\r\n      \/\/ Solarbotics RM2 -&gt; 2 Backward\r\n      digitalWrite(MOTOR2_IN2, LOW);\r\n      analogWrite(MOTOR2_IN1, iPower);\r\n      delay(10);\r\n\r\n      break;\r\n    case 4:\r\n\r\n      \/\/ Left\r\n      \/\/ Solarbotics RM2 -&gt; 1 Backward\r\n      digitalWrite(MOTOR1_IN2, LOW);\r\n      analogWrite(MOTOR1_IN1, iPower);\r\n      delay(10);\r\n\r\n      \/\/ Solarbotics RM2 -&gt; 2 Forward\r\n      digitalWrite(MOTOR2_IN1, LOW);\r\n      analogWrite(MOTOR2_IN2, iPower);\r\n      delay(10);\r\n      \r\n      break;\r\n    case 5:\r\n\r\n      \/\/ Stop\r\n      \/\/ NeoPixels Red\r\n      \/\/zz = 2;\r\n      \/\/isNUMPIXELS();\r\n      \/\/ Solarbotics RM2 -&gt; 1\r\n      digitalWrite(MOTOR1_IN1, LOW);\r\n      analogWrite(MOTOR1_IN2, 0);\r\n      delay(10);\r\n\r\n      \/\/ Solarbotics RM2 -&gt; 2 \r\n      digitalWrite(MOTOR2_IN1, LOW);\r\n      analogWrite(MOTOR2_IN2, 0);\r\n      delay(10); \r\n      \r\n      break;\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  Serial.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  \/\/ Setup Solarbotics RM2 Motor\r\n  isSetupRM2Motor();\r\n\r\n  \/\/ Pause\r\n  delay(5);\r\n  \r\n  \/\/ NeoPixels\r\n  \/\/ This initializes the NeoPixel library\r\n  pixels.begin();\r\n  \/\/ Delay for a period of time (in milliseconds)\r\n  delay(50);\r\n  \/\/ isNUMPIXELS Off\r\n  isNUMPIXELSoff();\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 #ArduinoProMini #XBee #DCMotor #MotorDriver #Project #Fritzing #Programming #Electronics #Microcontrollers #Consultant &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; LiPower Boost Converter The LiPower board is based on the incredibly versatile TPS61200 boost converter. The board is configured to be used with a LiPo battery, has solder jumper selectable 5V and 3.3V output, and &#8230; <a title=\"Project #12: Robotics &#8211; LiPower Boost Converter &#8211; Mk19\" class=\"read-more\" href=\"https:\/\/www.donluc.com\/?p=2970\" aria-label=\"Read more about Project #12: Robotics &#8211; LiPower Boost Converter &#8211; Mk19\">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,47,50,49,38,59,5,46,58,10,43],"tags":[86,6,92,102,4,19,85,201,24,103,9,27,95,109,33,34],"class_list":["post-2970","post","type-post","status-publish","format-standard","hentry","category-robotics-projerts","category-adafruit","category-arduino","category-consultant","category-digitalelectronics","category-fritzing","category-microcontrollers","category-pololu","category-arduino-programming","category-projects","category-sparkfun","tag-adafruit","tag-arduino","tag-battery","tag-components","tag-consultant","tag-electronics","tag-fritzing","tag-lipower-boost-converter","tag-microcontroller","tag-pololu","tag-programming","tag-projects-2","tag-robotic","tag-sparkfun","tag-technology","tag-video-blog"],"_links":{"self":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/2970","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=2970"}],"version-history":[{"count":1,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/2970\/revisions"}],"predecessor-version":[{"id":2975,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/2970\/revisions\/2975"}],"wp:attachment":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2970"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2970"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2970"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}