{"id":45,"date":"2017-03-15T15:35:04","date_gmt":"2017-03-15T15:35:04","guid":{"rendered":"http:\/\/danuc.in\/blog\/?p=45"},"modified":"2017-03-19T15:11:18","modified_gmt":"2017-03-19T15:11:18","slug":"blutooth-controlled-rover-robot","status":"publish","type":"post","link":"https:\/\/danuc.in\/blog\/2017\/03\/15\/blutooth-controlled-rover-robot\/","title":{"rendered":"Blutooth Controlled Rover Robot"},"content":{"rendered":"<figure id=\"attachment_70\" aria-describedby=\"caption-attachment-70\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-70 size-medium\" src=\"https:\/\/danuc.in\/blog\/wp-content\/uploads\/2017\/03\/hc-05_2-300x263.jpg\" alt=\"\" width=\"300\" height=\"263\" srcset=\"https:\/\/danuc.in\/blog\/wp-content\/uploads\/2017\/03\/hc-05_2-300x263.jpg 300w, https:\/\/danuc.in\/blog\/wp-content\/uploads\/2017\/03\/hc-05_2-600x526.jpg 600w, https:\/\/danuc.in\/blog\/wp-content\/uploads\/2017\/03\/hc-05_2-768x673.jpg 768w, https:\/\/danuc.in\/blog\/wp-content\/uploads\/2017\/03\/hc-05_2.jpg 772w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><figcaption id=\"caption-attachment-70\" class=\"wp-caption-text\">Bluetooth HC-05 module<\/figcaption><\/figure>\n<figure id=\"attachment_65\" aria-describedby=\"caption-attachment-65\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-65 size-medium\" src=\"https:\/\/danuc.in\/blog\/wp-content\/uploads\/2017\/03\/l293d-1-300x192.jpg\" alt=\"\" width=\"300\" height=\"192\" srcset=\"https:\/\/danuc.in\/blog\/wp-content\/uploads\/2017\/03\/l293d-1-300x192.jpg 300w, https:\/\/danuc.in\/blog\/wp-content\/uploads\/2017\/03\/l293d-1-600x383.jpg 600w, https:\/\/danuc.in\/blog\/wp-content\/uploads\/2017\/03\/l293d-1.jpg 678w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><figcaption id=\"caption-attachment-65\" class=\"wp-caption-text\">L293D Motor Controller chip<\/figcaption><\/figure>\n<figure id=\"attachment_61\" aria-describedby=\"caption-attachment-61\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-61 size-medium\" src=\"https:\/\/danuc.in\/blog\/wp-content\/uploads\/2017\/03\/arduinouno-300x253.jpg\" alt=\"\" width=\"300\" height=\"253\" srcset=\"https:\/\/danuc.in\/blog\/wp-content\/uploads\/2017\/03\/arduinouno-300x253.jpg 300w, https:\/\/danuc.in\/blog\/wp-content\/uploads\/2017\/03\/arduinouno-600x506.jpg 600w, https:\/\/danuc.in\/blog\/wp-content\/uploads\/2017\/03\/arduinouno-768x647.jpg 768w, https:\/\/danuc.in\/blog\/wp-content\/uploads\/2017\/03\/arduinouno-1024x863.jpg 1024w, https:\/\/danuc.in\/blog\/wp-content\/uploads\/2017\/03\/arduinouno.jpg 1200w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><figcaption id=\"caption-attachment-61\" class=\"wp-caption-text\">Arduino UNO<\/figcaption><\/figure>\n<figure id=\"attachment_72\" aria-describedby=\"caption-attachment-72\" style=\"width: 800px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-72 size-large\" src=\"https:\/\/danuc.in\/blog\/wp-content\/uploads\/2017\/03\/l293d_arduino_bb-1024x692.png\" alt=\"\" width=\"800\" height=\"541\" srcset=\"https:\/\/danuc.in\/blog\/wp-content\/uploads\/2017\/03\/l293d_arduino_bb-1024x692.png 1024w, https:\/\/danuc.in\/blog\/wp-content\/uploads\/2017\/03\/l293d_arduino_bb-600x405.png 600w, https:\/\/danuc.in\/blog\/wp-content\/uploads\/2017\/03\/l293d_arduino_bb-300x203.png 300w, https:\/\/danuc.in\/blog\/wp-content\/uploads\/2017\/03\/l293d_arduino_bb-768x519.png 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><figcaption id=\"caption-attachment-72\" class=\"wp-caption-text\">Arduino and L293 Connectivity Schematics or Circuit Diagram<\/figcaption><\/figure>\n<figure id=\"attachment_75\" aria-describedby=\"caption-attachment-75\" style=\"width: 225px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-75 size-medium\" src=\"https:\/\/danuc.in\/blog\/wp-content\/uploads\/2017\/03\/l293motorcontroller-225x300.jpg\" alt=\"\" width=\"225\" height=\"300\" srcset=\"https:\/\/danuc.in\/blog\/wp-content\/uploads\/2017\/03\/l293motorcontroller-225x300.jpg 225w, https:\/\/danuc.in\/blog\/wp-content\/uploads\/2017\/03\/l293motorcontroller.jpg 465w\" sizes=\"auto, (max-width: 225px) 100vw, 225px\" \/><figcaption id=\"caption-attachment-75\" class=\"wp-caption-text\">L293 Motor controller soldered on a Veroboard<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<figure id=\"attachment_58\" aria-describedby=\"caption-attachment-58\" style=\"width: 225px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-58 size-full\" src=\"https:\/\/danuc.in\/blog\/wp-content\/uploads\/2017\/03\/robot-chassis.jpg\" alt=\"\" width=\"225\" height=\"225\" srcset=\"https:\/\/danuc.in\/blog\/wp-content\/uploads\/2017\/03\/robot-chassis.jpg 225w, https:\/\/danuc.in\/blog\/wp-content\/uploads\/2017\/03\/robot-chassis-100x100.jpg 100w, https:\/\/danuc.in\/blog\/wp-content\/uploads\/2017\/03\/robot-chassis-150x150.jpg 150w\" sizes=\"auto, (max-width: 225px) 100vw, 225px\" \/><figcaption id=\"caption-attachment-58\" class=\"wp-caption-text\">Round Robot Chassis 60 inch diameter<\/figcaption><\/figure>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-51 size-medium\" src=\"https:\/\/danuc.in\/blog\/wp-content\/uploads\/2017\/03\/bo-motorand-wheel-set-219x300.jpg\" alt=\"\" width=\"219\" height=\"300\" srcset=\"https:\/\/danuc.in\/blog\/wp-content\/uploads\/2017\/03\/bo-motorand-wheel-set-219x300.jpg 219w, https:\/\/danuc.in\/blog\/wp-content\/uploads\/2017\/03\/bo-motorand-wheel-set.jpg 256w\" sizes=\"auto, (max-width: 219px) 100vw, 219px\" \/><\/p>\n<p>BO DC Motor and wheels set<\/p>\n<figure id=\"attachment_53\" aria-describedby=\"caption-attachment-53\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-53 size-medium\" title=\"BO Motor with metal mounting clamp\" src=\"https:\/\/danuc.in\/blog\/wp-content\/uploads\/2017\/03\/BOMotorClampwithMotor-300x180.jpg\" alt=\"\" width=\"300\" height=\"180\" srcset=\"https:\/\/danuc.in\/blog\/wp-content\/uploads\/2017\/03\/BOMotorClampwithMotor-300x180.jpg 300w, https:\/\/danuc.in\/blog\/wp-content\/uploads\/2017\/03\/BOMotorClampwithMotor-600x360.jpg 600w, https:\/\/danuc.in\/blog\/wp-content\/uploads\/2017\/03\/BOMotorClampwithMotor-768x461.jpg 768w, https:\/\/danuc.in\/blog\/wp-content\/uploads\/2017\/03\/BOMotorClampwithMotor.jpg 1024w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><figcaption id=\"caption-attachment-53\" class=\"wp-caption-text\">This shows BO Motor with metal mounting clamp<\/figcaption><\/figure>\n<figure id=\"attachment_52\" aria-describedby=\"caption-attachment-52\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-52 size-medium\" src=\"https:\/\/danuc.in\/blog\/wp-content\/uploads\/2017\/03\/bo-motor-clamp-500x500-300x296.png\" alt=\"\" width=\"300\" height=\"296\" srcset=\"https:\/\/danuc.in\/blog\/wp-content\/uploads\/2017\/03\/bo-motor-clamp-500x500-300x296.png 300w, https:\/\/danuc.in\/blog\/wp-content\/uploads\/2017\/03\/bo-motor-clamp-500x500-100x100.png 100w, https:\/\/danuc.in\/blog\/wp-content\/uploads\/2017\/03\/bo-motor-clamp-500x500.png 411w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><figcaption id=\"caption-attachment-52\" class=\"wp-caption-text\">This is another image with BO Motor with metal mounting clamp<\/figcaption><\/figure>\n<figure id=\"attachment_59\" aria-describedby=\"caption-attachment-59\" style=\"width: 228px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-59 size-full\" src=\"https:\/\/danuc.in\/blog\/wp-content\/uploads\/2017\/03\/rover_3-228x228.jpg\" alt=\"\" width=\"228\" height=\"228\" srcset=\"https:\/\/danuc.in\/blog\/wp-content\/uploads\/2017\/03\/rover_3-228x228.jpg 228w, https:\/\/danuc.in\/blog\/wp-content\/uploads\/2017\/03\/rover_3-228x228-100x100.jpg 100w, https:\/\/danuc.in\/blog\/wp-content\/uploads\/2017\/03\/rover_3-228x228-150x150.jpg 150w\" sizes=\"auto, (max-width: 228px) 100vw, 228px\" \/><figcaption id=\"caption-attachment-59\" class=\"wp-caption-text\">Completely Assembled Rover Robot<\/figcaption><\/figure>\n<p>This is my first post and i hope you all will like it.this robot i have built several times for Engineering and science college final year students here in India.<\/p>\n<p>The Above Pics show the list of components needed and the schematics of how to connect Arduino Uno to l293d motor controller chip.<\/p>\n<p>One thing to specify here is one needs to have basic knowledge in electronics to complete this robot or one should take guidance from one who understands electronics.<\/p>\n<p>Once you built the robot and built the complete controller \u00a0electronics according to the schematics or the circuit diagram image i have shown above ,interface your bot with PC or your laptop make sure it has Arduino IDE software installed on it or download and install it from <a href=\"https:\/\/www.arduino.cc\/en\/Main\/Software\">Arduino.cc<\/a> website for free.<\/p>\n<p>Open Arduino IDE on your PC and click open new sketch for file menu.<\/p>\n<p>in new sketch delete everything present in the sketch and copy and paste following code.make sure that you have selected proper serial port for Arduino detected in device manager in windows.also make sure Arduino Uno is selected under boards menu under Tools menu.<\/p>\n<p>verify and upload code by clicking necessary arduino IDE buttons.<\/p>\n<p>wait till code is loaded and if everything is fine than robot should start working.<\/p>\n<p>This \u00a0code is only for testing robot motors the Bluetooth control code has to be blended with the present code later if basic robot is working.<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; copy\u00a0 CODE from Below this line &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>&nbsp;<\/p>\n<p>\/*<br \/>\nL293 based basic Robot Control code.This code is for testing the basic functionality i.e whether motors are working using arduino software control .<\/p>\n<p>This example code is in the public domain.<br \/>\n*\/<\/p>\n<p>\/\/ Pin 13 has an LED connected on most Arduino boards.<br \/>\n\/\/ give it a name:<\/p>\n<p>int enableA = 5; \/\/\/pin6 of l293<br \/>\nint input1 = 6; \/\/\/pin5 of l293<br \/>\nint input2 = 7; \/\/\/pin7 of l293<\/p>\n<p>int enableB = 9; \/\/\/pin11 of l293<br \/>\nint input3 = 10; \/\/\/pin10 of l293<br \/>\nint input4 = 15; \/\/\/pin12 of l293<\/p>\n<p>\/\/ the setup routine runs once when you press reset:<br \/>\nvoid setup() {<br \/>\n\/\/ initialize the digital pin as an output.<br \/>\npinMode(enableA, OUTPUT);<br \/>\npinMode(enableB, OUTPUT);<br \/>\npinMode(input1, OUTPUT);<br \/>\npinMode(input2, OUTPUT);<br \/>\npinMode(input3, OUTPUT);<br \/>\npinMode(input4, OUTPUT);<br \/>\n}<\/p>\n<p>\/\/ the loop routine runs over and over again forever:<br \/>\nvoid loop()<\/p>\n<p>{<br \/>\nforward();<\/p>\n<p>}<\/p>\n<p>int reverse(){<\/p>\n<p>digitalWrite(input1,LOW ); \/\/ turn the LED on (HIGH is the voltage level)<\/p>\n<p>digitalWrite(input2,HIGH); \/\/ turn the LED off by making the voltage LOW<\/p>\n<p>digitalWrite(input3, HIGH); \/\/ turn the LED on (HIGH is the voltage level)<\/p>\n<p>digitalWrite(input4, LOW); \/\/ turn the LED off by making the voltage LOW<\/p>\n<p>digitalWrite(enableA, HIGH); \/\/ turn the LED on (HIGH is the voltage level)<\/p>\n<p>digitalWrite(enableB, HIGH); \/\/ tur<br \/>\n}<\/p>\n<p>int forward(){<\/p>\n<p>digitalWrite(input1,HIGH ); \/\/ turn the LED on (HIGH is the voltage level)<\/p>\n<p>digitalWrite(input2,LOW); \/\/ turn the LED off by making the voltage LOW<\/p>\n<p>digitalWrite(input3,LOW ); \/\/ turn the LED on (HIGH is the voltage level)<\/p>\n<p>digitalWrite(input4,HIGH ); \/\/ turn the LED off by making the voltage LOW<\/p>\n<p>digitalWrite(enableA, HIGH); \/\/ turn the LED on (HIGH is the voltage level)<\/p>\n<p>digitalWrite(enableB, HIGH); \/\/ turn the LED off by making the voltage LOW<br \/>\n}<br \/>\nint turnright(){<\/p>\n<p>digitalWrite(input1,LOW ); \/\/ turn the LED on (HIGH is the voltage level)<\/p>\n<p>digitalWrite(input2,HIGH); \/\/ turn the LED off by making the voltage LOW<\/p>\n<p>digitalWrite(input3,LOW ); \/\/ turn the LED on (HIGH is the voltage level)<br \/>\n\/\/<br \/>\ndigitalWrite(input4,HIGH ); \/\/ turn the LED off by making the voltage LOW<\/p>\n<p>digitalWrite(enableA, HIGH); \/\/ turn the LED on (HIGH is the voltage level)<\/p>\n<p>digitalWrite(enableB, HIGH); \/\/ turn the LED off by making the voltage LOW<br \/>\n}<\/p>\n<p>int turnleft()<br \/>\n{<\/p>\n<p>digitalWrite(input1,HIGH ); \/\/ turn the LED on (HIGH is the voltage level)<\/p>\n<p>digitalWrite(input2,LOW); \/\/ turn the LED off by making the voltage LOW<\/p>\n<p>digitalWrite(input3,HIGH ); \/\/ turn the LED on (HIGH is the voltage level)<\/p>\n<p>digitalWrite(input4,LOW ); \/\/ turn the LED off by making the voltage LOW<\/p>\n<p>digitalWrite(enableA, HIGH); \/\/ turn the LED on (HIGH is the voltage level)<\/p>\n<p>digitalWrite(enableB, HIGH); \/\/ turn the LED off by making the voltage LOW<br \/>\n}<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; copy\u00a0 CODE from above this line &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>This robot is controlled using freely available Arduino Apps for Android phone available on Google Play.<\/p>\n<p>kindly go through following page and down this app for free on you android or tab which will allow you to control your bot using android phone.<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/play.google.com\/store\/apps\/details?id=appinventor.ai_hobbyprojects_com.BluetoothRoboControl&amp;hl=en\">https:\/\/play.google.com\/store\/apps\/details?id=appinventor.ai_hobbyprojects_com.BluetoothRoboControl&amp;hl=en<\/a><\/p>\n<p>The page through the courtesy of\u00a0<a class=\"document-subtitle primary\" href=\"https:\/\/play.google.com\/store\/apps\/developer?id=Hobbyprojects.com\">Hobbyprojects.com <\/a><\/p>\n<p>has following instructions kindly go through them they are very easy to understand.they are as follows:<br \/>\nApp Instructions:<br \/>\n1. First make sure your HC-05 Bluetooth Module is paired with your mobile. The default password for pairing is &#8220;1234&#8221; or &#8220;0000&#8221;. Check the manual of Bluetooth module.<\/p>\n<p>2. Click on &#8220;SELECT DEVICE&#8221; icon to select paired Bluetooth module.<\/p>\n<p>3. When you press &#8220;UP Arrow&#8221; it sends the data &#8220;A&#8221; to Bluetooth Module connected with the circuit. When Microcontroller detects &#8220;A&#8221; the Robot \/ Robot Car moves FORWARD.<\/p>\n<p>4. When you press &#8220;Down Arrow&#8221; it sends the data &#8220;B&#8221; to Bluetooth Module connected with the circuit. When Microcontroller detects &#8220;B&#8221; the Robot \/ Robot Car moves REVERSE.<\/p>\n<p>5. When you press &#8220;LEFT Arrow&#8221; it sends the data &#8220;C&#8221; to Bluetooth Module connected with the circuit. When Microcontroller detects &#8220;C&#8221; the Robot \/ Robot Car turns LEFT.<\/p>\n<p>6. When you press &#8220;RIGHT Arrow&#8221; it sends the data &#8220;D&#8221; to Bluetooth Module connected with the circuit. When Microcontroller detects &#8220;D&#8221; the Robot \/ Robot Car turns RIGHT.<\/p>\n<p>7. When you press &#8220;STOP&#8221; button which is in the center of remote it sends the data &#8220;E&#8221; to Bluetooth Module connected with the circuit. When Microcontroller detects &#8220;E&#8221; the Robot \/ Robot Car gets STOPPED.<\/p>\n<p>8. When you press &#8220;360 Degree&#8221; button it sends the data &#8220;F&#8221; to Bluetooth Module connected with the circuit. When Microcontroller detects &#8220;F&#8221; the Robot \/ Robot Car rotates CLOCKWISE on the same position.<\/p>\n<p>9. When you press &#8220;-360 Degree&#8221; button it sends the data &#8220;G&#8221; to Bluetooth Module connected with the circuit. When Microcontroller detects &#8220;G&#8221; the Robot \/ Robot Car rotates ANTI-CLOCKWISE on the same position.<\/p>\n<p>10. Click on &#8220;DISCONNECT&#8221; icon to disconnect paired Bluetooth module.<\/p>\n<p>Now i will consider that your basic \u00a0robot without bluetooth is working fine, that means wheels of robot are rotating in one direction.<\/p>\n<p>now go through the below image and wire your Bluetooth Module to the robot.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-126\" src=\"https:\/\/danuc.in\/blog\/wp-content\/uploads\/2017\/03\/l293d_arduino_bluetooth-300x203.png\" alt=\"\" width=\"498\" height=\"337\" srcset=\"https:\/\/danuc.in\/blog\/wp-content\/uploads\/2017\/03\/l293d_arduino_bluetooth-300x203.png 300w, https:\/\/danuc.in\/blog\/wp-content\/uploads\/2017\/03\/l293d_arduino_bluetooth-600x405.png 600w, https:\/\/danuc.in\/blog\/wp-content\/uploads\/2017\/03\/l293d_arduino_bluetooth-768x519.png 768w, https:\/\/danuc.in\/blog\/wp-content\/uploads\/2017\/03\/l293d_arduino_bluetooth-1024x691.png 1024w\" sizes=\"auto, (max-width: 498px) 100vw, 498px\" \/><\/p>\n<p>Once Bluetooth has been wired sucessfully kindly upload the complete code given below.<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; copy\u00a0 CODE from below\u00a0this line &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>\/*Thia cod is for L293Chip<br \/>\nThis is basic obstacle avoidance reverse forward rover robot code by Danuc Robotics India<br \/>\nworks great<br \/>\nThis example code is in the public domain.<br \/>\n*\/<br \/>\n#include &lt;SoftwareSerial.h&gt;\/\/ import the serial library<\/p>\n<p>SoftwareSerial tron(2, 3); \/\/ RX, TX<br \/>\nint ledpin=7; \/\/ led on D13 will show blink on \/ off<br \/>\nint BluetoothData; \/\/ the data given from Computer<\/p>\n<p>\/\/ Pin 13 has an LED connected on most Arduino boards.<br \/>\n\/\/ give it a name:<br \/>\nint sensorPin = A5; \/\/ select the input pin for the potentiometer<br \/>\nint ledPin = 13; \/\/ select the pin for the LED<br \/>\nint sensorValue = 0; \/\/ variable to store the value coming from the sensor<\/p>\n<p>int enableA = 5; \/\/\/pin6 of l293<br \/>\nint input1 = 6; \/\/\/pin5 of l293<br \/>\nint input2 = 7; \/\/\/pin7 of l293<br \/>\nint enableB = 9; \/\/\/pin11 of l293<br \/>\nint input3 = 10; \/\/\/pin10 of l293<br \/>\nint input4 = 15; \/\/\/pin12 of l293<\/p>\n<p>\/\/ the setup routine runs once when you press reset:<br \/>\nvoid setup() {<br \/>\nSerial.begin(9600);<\/p>\n<p>\/\/ put your setup code here, to run once:<br \/>\ntron.begin(9600);<br \/>\nSerial.begin(9600);<br \/>\nSerial.println(&#8220;Danuc Robotics Bluetooth control&#8221;);<br \/>\npinMode(ledpin,OUTPUT);<br \/>\n\/\/ initialize the digital pin as an output.<br \/>\ndigitalWrite(enableA, HIGH); \/\/ turn the LED on (HIGH is the voltage level)<br \/>\ndigitalWrite(enableB, HIGH); \/\/ turn the LED off by making the voltage LOW<\/p>\n<p>pinMode(enableA, OUTPUT);<br \/>\npinMode(enableB, OUTPUT);<br \/>\npinMode(input1, OUTPUT);<br \/>\npinMode(input2, OUTPUT);<br \/>\npinMode(input3, OUTPUT);<br \/>\npinMode(input4, OUTPUT);<br \/>\n}<\/p>\n<p>\/\/ the loop routine runs over and over again forever:<br \/>\nvoid loop()<br \/>\n{<br \/>\nif (tron.available()){<br \/>\nBluetoothData=tron.read();<br \/>\nSerial.println(BluetoothData);<br \/>\n}<\/p>\n<p>delay(1); \/\/ delay in between reads for stability<br \/>\nif(BluetoothData==&#8217;A&#8217;)<br \/>\n{<br \/>\nreverse();<br \/>\n}<br \/>\nelse if(BluetoothData==&#8217;B&#8217;)<\/p>\n<p>{<br \/>\nforward();<br \/>\n}<br \/>\nelse if(BluetoothData==&#8217;C&#8217;)<\/p>\n<p>{<br \/>\nturnleft();<br \/>\n}<br \/>\nelse if(BluetoothData==&#8217;D&#8217;)<\/p>\n<p>{<br \/>\nturnright();<br \/>\n}<br \/>\n}<\/p>\n<p>int reverse(){<\/p>\n<p>digitalWrite(input1,LOW ); \/\/ turn the LED on (HIGH is the voltage level)<\/p>\n<p>digitalWrite(input2,HIGH); \/\/ turn the LED off by making the voltage LOW<\/p>\n<p>digitalWrite(input3, HIGH); \/\/ turn the LED on (HIGH is the voltage level)<\/p>\n<p>digitalWrite(input4, LOW); \/\/ turn the LED off by making the voltage LOW<\/p>\n<p>digitalWrite(enableA, HIGH); \/\/ turn the LED on (HIGH is the voltage level)<\/p>\n<p>digitalWrite(enableB, HIGH); \/\/ tur<br \/>\n}<\/p>\n<p>int forward(){<\/p>\n<p>digitalWrite(input1,HIGH ); \/\/ turn the LED on (HIGH is the voltage level)<\/p>\n<p>digitalWrite(input2,LOW); \/\/ turn the LED off by making the voltage LOW<\/p>\n<p>digitalWrite(input3,LOW ); \/\/ turn the LED on (HIGH is the voltage level)<\/p>\n<p>digitalWrite(input4,HIGH ); \/\/ turn the LED off by making the voltage LOW<\/p>\n<p>digitalWrite(enableA, HIGH); \/\/ turn the LED on (HIGH is the voltage level)<\/p>\n<p>digitalWrite(enableB, HIGH); \/\/ turn the LED off by making the voltage LOW<br \/>\n}<br \/>\nint turnright(){<\/p>\n<p>digitalWrite(input1,LOW ); \/\/ turn the LED on (HIGH is the voltage level)<\/p>\n<p>digitalWrite(input2,HIGH); \/\/ turn the LED off by making the voltage LOW<\/p>\n<p>digitalWrite(input3,LOW ); \/\/ turn the LED on (HIGH is the voltage level)<br \/>\n\/\/<br \/>\ndigitalWrite(input4,HIGH ); \/\/ turn the LED off by making the voltage LOW<\/p>\n<p>digitalWrite(enableA, HIGH); \/\/ turn the LED on (HIGH is the voltage level)<\/p>\n<p>digitalWrite(enableB, HIGH); \/\/ turn the LED off by making the voltage LOW<br \/>\n}<\/p>\n<p>int turnleft()<br \/>\n{<\/p>\n<p>digitalWrite(input1,HIGH ); \/\/ turn the LED on (HIGH is the voltage level)<\/p>\n<p>digitalWrite(input2,LOW); \/\/ turn the LED off by making the voltage LOW<\/p>\n<p>digitalWrite(input3,HIGH ); \/\/ turn the LED on (HIGH is the voltage level)<\/p>\n<p>digitalWrite(input4,LOW ); \/\/ turn the LED off by making the voltage LOW<\/p>\n<p>digitalWrite(enableA, HIGH); \/\/ turn the LED on (HIGH is the voltage level)<\/p>\n<p>digitalWrite(enableB, HIGH); \/\/ turn the LED off by making the voltage LOW<br \/>\n}<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; copy\u00a0 CODE from above this line &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>Using Arduino IDE please upload the new code ,the way you deed for earlier test code.Next using the bluetooth app \u00a0i had discussed earlier, pair your phone with the robot and test whether the robot goes forward or reverse and left and right, if it does than booooomba!!!!!!! you have successfully built your first robot.<\/p>\n<p>If \u00a0you need any help kindly leave comment by filling form below but make sure you first register on my blog.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; BO DC Motor and wheels set This is my first post and i hope you all will like it.this&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"gallery","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-45","post","type-post","status-publish","format-gallery","hentry","category-robot-for-kidz","post_format-post-format-gallery"],"_links":{"self":[{"href":"https:\/\/danuc.in\/blog\/wp-json\/wp\/v2\/posts\/45","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/danuc.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/danuc.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/danuc.in\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/danuc.in\/blog\/wp-json\/wp\/v2\/comments?post=45"}],"version-history":[{"count":22,"href":"https:\/\/danuc.in\/blog\/wp-json\/wp\/v2\/posts\/45\/revisions"}],"predecessor-version":[{"id":128,"href":"https:\/\/danuc.in\/blog\/wp-json\/wp\/v2\/posts\/45\/revisions\/128"}],"wp:attachment":[{"href":"https:\/\/danuc.in\/blog\/wp-json\/wp\/v2\/media?parent=45"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/danuc.in\/blog\/wp-json\/wp\/v2\/categories?post=45"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/danuc.in\/blog\/wp-json\/wp\/v2\/tags?post=45"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}