User:Eshipley/my work 3/RobotCarCode

// Adafruit Motor shield library // copyright Adafruit Industries LLC, 2009 // this code is public domain, enjoy!


 * 1) include 
 * 2) include 

// DC motor on M2 AF_DCMotor motor(2); AF_DCMotor motors(3); // DC hobby servo

void setup { Serial.begin(9600);          // set up Serial library at 9600 bps Serial.println("Motor party!"); // turn on motor #2 and #3 motor.setSpeed(200); motor.run(RELEASE); motors.setSpeed(200); motors.run(RELEASE); }

int i;

// Test the DC motor, stepper and servo ALL AT ONCE! void loop { motor.run(FORWARD); motors.run(FORWARD); for (i=0; i<255; i++) { motor.setSpeed(i); motors.setSpeed(i); delay(3); } for (i=255; i!=0; i--) { motor.setSpeed(i); motors.setSpeed(i); delay(3); }  motor.run(BACKWARD); motors.run(BACKWARD); for (i=0; i<255; i++) { motor.setSpeed(i); motors.setSpeed(i); delay(3); } for (i=255; i!=0; i--) { motor.setSpeed(i); motors.setSpeed(i); delay(3); } }