/********************************************** e-Gizmo PBOT Controller - PBotBTControlled.ino This is for controlling the PBOT using Bluetoooth Wireless module via Smartphones. Upload thi sketch and download the app on Google Playtore. Search for "e-Gizmo BT Controlled eBOT". Kindly also follow the screenshot instructions given on the app for pairing the bluetooth device to your phone. Codes by e-Gizmo Mechatronix Central http://www.e-gizmo.net March 17,2020 ************************************************/ #include "eGizmo_PBot_Uno.h" #include eGizmo_PBot_Uno PBot; int MotorSpeed = 200; //Maximum Speed byte INPUT_FROM_ANDROID_APP; void setup() { Serial.begin(9600); PBot.BEGIN(); } // MAIN PROGRAM void loop() { if (Serial.available() > 0) { INPUT_FROM_ANDROID_APP = Serial.read(); Serial.println(INPUT_FROM_ANDROID_APP); } if (INPUT_FROM_ANDROID_APP == 11) { PBot.FORWARD(MotorSpeed); } if (INPUT_FROM_ANDROID_APP == 12) { PBot.REVERSE(MotorSpeed); } if (INPUT_FROM_ANDROID_APP == 13) { PBot.SPINLEFT(MotorSpeed); } if (INPUT_FROM_ANDROID_APP == 14) { PBot.SPINRIGHT(MotorSpeed); } if (INPUT_FROM_ANDROID_APP == 0) { PBot.STOP(); } if (INPUT_FROM_ANDROID_APP == 17) { //PBot.SERVO(1,95); //delay(15); } if (INPUT_FROM_ANDROID_APP == 18) { // Put your codes here } if (INPUT_FROM_ANDROID_APP == 15) { // Put your codes here } if (INPUT_FROM_ANDROID_APP == 16) { // Put your codes here } } /********************************************** e-Gizmo PBOT Controller - PBotBTControlled.ino This is for controlling the PBOT using Bluetoooth Wireless module via Smartphones. Upload thi sketch and download the app on Google Playtore. Search for "e-Gizmo BT Controlled eBOT". Kindly also follow the screenshot instructions given on the app for pairing the bluetooth device to your phone. Codes by e-Gizmo Mechatronix Central http://www.e-gizmo.net March 17,2020 ************************************************/ #include "eGizmo_PBot_Uno.h" #include eGizmo_PBot_Uno PBot; int MotorSpeed = 200; //Maximum Speed byte INPUT_FROM_ANDROID_APP; void setup() { Serial.begin(9600); PBot.BEGIN(); } // MAIN PROGRAM void loop() { if (Serial.available() > 0) { INPUT_FROM_ANDROID_APP = Serial.read(); Serial.println(INPUT_FROM_ANDROID_APP); } if (INPUT_FROM_ANDROID_APP == 11) { PBot.FORWARD(MotorSpeed); } if (INPUT_FROM_ANDROID_APP == 12) { PBot.REVERSE(MotorSpeed); } if (INPUT_FROM_ANDROID_APP == 13) { PBot.SPINLEFT(MotorSpeed); } if (INPUT_FROM_ANDROID_APP == 14) { PBot.SPINRIGHT(MotorSpeed); } if (INPUT_FROM_ANDROID_APP == 0) { PBot.STOP(); } if (INPUT_FROM_ANDROID_APP == 17) { //PBot.SERVO(1,95); //delay(15); } if (INPUT_FROM_ANDROID_APP == 18) { // Put your codes here } if (INPUT_FROM_ANDROID_APP == 15) { // Put your codes here } if (INPUT_FROM_ANDROID_APP == 16) { // Put your codes here } }