Posts

Showing posts with the label robo race

Robo Race / Robo Soccer

 This code Below is the Perfect Code for controlling Arduino Bots. REMEMBER : if you know how to do connections then this code is an elixir for you because unlike previous posts i have provided circuit diagram for connections, but this time this code is prepared by me and i made connections through understanding of code itself.  Enjoy!! **-----new code starts here, the 4 motor code smooth working-----** int m1a = 9;  // Motor 1, Pin A int m1b = 10; // Motor 1, Pin B int m2a = 11; // Motor 2, Pin A int m2b = 12; // Motor 2, Pin B char val; void setup() {   pinMode(m1a, OUTPUT);   pinMode(m1b, OUTPUT);   pinMode(m2a, OUTPUT);   pinMode(m2b, OUTPUT);   Serial.begin(9600); } void loop() {   while (Serial.available() > 0) {     val = Serial.read();     Serial.println(val);   }   if (val == 'F') { // Forward     digitalWrite(m1a, HIGH);     digitalWrite(m1b, LOW);     digitalWrite(m2a, ...