Page 133 - KEC Khaitan C8.2 Flipbook
P. 133

o  “S” for Stop



























                 Testing App Connectivity

                 ●  Ensure Bluetooth module is paired with the smartphone.

                 ●  Test sending commands and observe serial output in Arduino.


                 Building and Programming the Smart Robot Car
                 Writing the Final Arduino Code

                 #include <SoftwareSerial.h>

                 SoftwareSerial BTSerial(10, 11); // RX, TX



                 #define IN1 6

                 #define IN2 7

                 #define IN3 8
                 #define IN4 9




                 void setup() {

                   Serial.begin(9600);
                   BTSerial.begin(9600);



                   pinMode(IN1, OUTPUT);
                   pinMode(IN2, OUTPUT);

                   pinMode(IN3, OUTPUT);

                   pinMode(IN4, OUTPUT);


                                                                                                 Hands-On Project  131
   128   129   130   131   132   133   134   135   136   137   138