Chess Playing Robot
Supplies
3x servos
1 motor controller
2x dc gearbox motors
2x battery packs
A bunch of electronic copenents
Construction
Wiring
Code
#include
Servo servoMain1; // Define our 1st Servo Servo servoMain2; // Define our 2nd Servo Servo servoMain3; // Define our 3rd Servo void setup() { servoMain1.attach(2); // servo1 on digital pin 2 servoMain2.attach(3); // servo2 on digital pin 3 servoMain3.attach(4); // servo3 on digital pin 4 } void loop() { servoMain1.write(0); // Turn Servo1 to 0 degrees servoMain2.write(90); // Turn Servo2 to center position (90 degrees) servoMain3.write(180); // Turn Servo3 180 degrees delay(1000); // Wait 1 second servoMain1.write(180); // Turn Servo1 to 180 degrees servoMain2.write(135); // Turn Servo2 135 degrees servoMain3.write(90); // Turn Servo3 to center position (90 degrees) delay(1000); // Wait 1 second } // C++ code // void setup() { pinMode(10, OUTPUT); pinMode(12, OUTPUT); }
void loop() { digitalWrite(10, HIGH); digitalWrite(12, HIGH); delay(5000); // Wait for 5000 millisecond(s) digitalWrite(10, LOW); digitalWrite(12, LOW); delay(5000); // Wait for 5000 millisecond(s)
sorry its a mess and its not the full thing