/*this works with both motors turning in unison, with the positive of each motor on the chip end of the motor connectors. * pin 12 goes to IN1, pin 8 goes to IN3. pin 12 & 8 are FORWARD when high and 9 & 13 LOW. * see hookup image in lesson, I have the RIGHT motor going to MOTOR B */ void setup() { // put your setup code here, to run once: pinMode (13, OUTPUT); pinMode (12, OUTPUT); pinMode (11, OUTPUT); pinMode (10, OUTPUT); pinMode (9, OUTPUT); pinMode (8, OUTPUT); } void loop() { // put your main code here, to run repeatedly: //step ahead digitalWrite (12, HIGH); digitalWrite (13, LOW); digitalWrite (8, HIGH); digitalWrite (9, LOW); //turn on the motors digitalWrite (11, HIGH); digitalWrite (10, HIGH); delay (100); //turn off the motors digitalWrite (11, LOW); digitalWrite (10, LOW); delay (430); //step back digitalWrite (12, LOW); digitalWrite (13, HIGH); digitalWrite (8, LOW); digitalWrite (9, HIGH); //turn on the motors digitalWrite (11, HIGH); digitalWrite (10, HIGH); delay (100); //turn off the motors digitalWrite (11, LOW); digitalWrite (10, LOW); delay (430); //step ahead digitalWrite (12, HIGH); digitalWrite (13, LOW); digitalWrite (8, HIGH); digitalWrite (9, LOW); //turn on the motors digitalWrite (11, HIGH); digitalWrite (10, HIGH); delay (100); //turn off the motors digitalWrite (11, LOW); digitalWrite (10, LOW); delay (430); //step back digitalWrite (12, LOW); digitalWrite (13, HIGH); digitalWrite (8, LOW); digitalWrite (9, HIGH); //turn on the motors digitalWrite (11, HIGH); digitalWrite (10, HIGH); delay (100); //turn off the motors digitalWrite (11, LOW); digitalWrite (10, LOW); delay (430);//step ahead digitalWrite (12, HIGH); digitalWrite (13, LOW); digitalWrite (8, HIGH); digitalWrite (9, LOW); //turn on the motors digitalWrite (11, HIGH); digitalWrite (10, HIGH); delay (100); //turn off the motors digitalWrite (11, LOW); digitalWrite (10, LOW); delay (430); //step back digitalWrite (12, LOW); digitalWrite (13, HIGH); digitalWrite (8, LOW); digitalWrite (9, HIGH); //turn on the motors digitalWrite (11, HIGH); digitalWrite (10, HIGH); delay (100); //turn off the motors digitalWrite (11, LOW); digitalWrite (10, LOW); delay (430);//step ahead digitalWrite (12, HIGH); digitalWrite (13, LOW); digitalWrite (8, HIGH); digitalWrite (9, LOW); //turn on the motors digitalWrite (11, HIGH); digitalWrite (10, HIGH); delay (100); //turn off the motors digitalWrite (11, LOW); digitalWrite (10, LOW); delay (430); //step back digitalWrite (12, LOW); digitalWrite (13, HIGH); digitalWrite (8, LOW); digitalWrite (9, HIGH); //turn on the motors digitalWrite (11, HIGH); digitalWrite (10, HIGH); delay (100); //turn off the motors digitalWrite (11, LOW); digitalWrite (10, LOW); delay (430);//step ahead digitalWrite (12, HIGH); digitalWrite (13, LOW); digitalWrite (8, HIGH); digitalWrite (9, LOW); //turn on the motors digitalWrite (11, HIGH); digitalWrite (10, HIGH); delay (100); //turn off the motors digitalWrite (11, LOW); digitalWrite (10, LOW); delay (430); //step back digitalWrite (12, LOW); digitalWrite (13, HIGH); digitalWrite (8, LOW); digitalWrite (9, HIGH); //turn on the motors digitalWrite (11, HIGH); digitalWrite (10, HIGH); delay (100); //turn off the motors digitalWrite (11, LOW); digitalWrite (10, LOW); delay (430);//step ahead digitalWrite (12, HIGH); digitalWrite (13, LOW); digitalWrite (8, HIGH); digitalWrite (9, LOW); //turn on the motors digitalWrite (11, HIGH); digitalWrite (10, HIGH); delay (100); //turn off the motors digitalWrite (11, LOW); digitalWrite (10, LOW); delay (430); //step back digitalWrite (12, LOW); digitalWrite (13, HIGH); digitalWrite (8, LOW); digitalWrite (9, HIGH); //turn on the motors digitalWrite (11, HIGH); digitalWrite (10, HIGH); delay (100); //turn off the motors digitalWrite (11, LOW); digitalWrite (10, LOW); delay (430);//step ahead digitalWrite (12, HIGH); digitalWrite (13, LOW); digitalWrite (8, HIGH); digitalWrite (9, LOW); //turn on the motors digitalWrite (11, HIGH); digitalWrite (10, HIGH); delay (100); //turn off the motors digitalWrite (11, LOW); digitalWrite (10, LOW); delay (430); //step back digitalWrite (12, LOW); digitalWrite (13, HIGH); digitalWrite (8, LOW); digitalWrite (9, HIGH); //turn on the motors digitalWrite (11, HIGH); digitalWrite (10, HIGH); delay (100); //turn off the motors digitalWrite (11, LOW); digitalWrite (10, LOW); delay (430); //********************************** //aaaand dosee-doh digitalWrite (12, HIGH); digitalWrite (13, LOW); digitalWrite (8, LOW); digitalWrite (9, HIGH); //turn on the motors digitalWrite (11, HIGH); digitalWrite (10, HIGH); delay (1100); //turn off the motors digitalWrite (11, LOW); digitalWrite (10, LOW); delay (1000); //Let's throw some half-time shuffle right/left moves in //step forward right digitalWrite (12, HIGH); digitalWrite (13, LOW); //turn on the motors digitalWrite (11, HIGH); delay (100); //turn off the motors digitalWrite (11, LOW); delay (115); //step backward from right digitalWrite (12, LOW); digitalWrite (13, HIGH); //turn on the motors digitalWrite (11, HIGH); delay (100); //turn off the motors digitalWrite (11, LOW); delay (115); //step forward left digitalWrite (8, HIGH); digitalWrite (9, LOW); //turn on the motors digitalWrite (10, HIGH); delay (100); //turn off the motors digitalWrite (10, LOW); delay (115); //step backward from left digitalWrite (8, LOW); digitalWrite (9, HIGH); //turn on the motors digitalWrite (10, HIGH); delay (100); //turn off the motors digitalWrite (10, LOW); delay (115); //step forward right digitalWrite (12, HIGH); digitalWrite (13, LOW); //turn on the motors digitalWrite (11, HIGH); delay (100); //turn off the motors digitalWrite (11, LOW); delay (115); //step backward from right digitalWrite (12, LOW); digitalWrite (13, HIGH); //turn on the motors digitalWrite (11, HIGH); delay (100); //turn off the motors digitalWrite (11, LOW); delay (115); //step forward left digitalWrite (8, HIGH); digitalWrite (9, LOW); //turn on the motors digitalWrite (10, HIGH); delay (100); //turn off the motors digitalWrite (10, LOW); delay (115); //step backward from left digitalWrite (8, LOW); digitalWrite (9, HIGH); //turn on the motors digitalWrite (10, HIGH); delay (100); //turn off the motors digitalWrite (10, LOW); delay (115); //step forward right digitalWrite (12, HIGH); digitalWrite (13, LOW); //turn on the motors digitalWrite (11, HIGH); delay (100); //turn off the motors digitalWrite (11, LOW); delay (115); //step backward from right digitalWrite (12, LOW); digitalWrite (13, HIGH); //turn on the motors digitalWrite (11, HIGH); delay (100); //turn off the motors digitalWrite (11, LOW); delay (115); //step forward left digitalWrite (8, HIGH); digitalWrite (9, LOW); //turn on the motors digitalWrite (10, HIGH); delay (100); //turn off the motors digitalWrite (10, LOW); delay (115); //step backward from left digitalWrite (8, LOW); digitalWrite (9, HIGH); //turn on the motors digitalWrite (10, HIGH); delay (100); //turn off the motors digitalWrite (10, LOW); delay (115); //step forward right digitalWrite (12, HIGH); digitalWrite (13, LOW); //turn on the motors digitalWrite (11, HIGH); delay (100); //turn off the motors digitalWrite (11, LOW); delay (115); //step backward from right digitalWrite (12, LOW); digitalWrite (13, HIGH); //turn on the motors digitalWrite (11, HIGH); delay (100); //turn off the motors digitalWrite (11, LOW); delay (115); //step forward left digitalWrite (8, HIGH); digitalWrite (9, LOW); //turn on the motors digitalWrite (10, HIGH); delay (100); //turn off the motors digitalWrite (10, LOW); delay (115); //step backward from left digitalWrite (8, LOW); digitalWrite (9, HIGH); //turn on the motors digitalWrite (10, HIGH); delay (100); //turn off the motors digitalWrite (10, LOW); delay (115); //********************************** //aaaand turn around digitalWrite (12, HIGH); digitalWrite (13, LOW); digitalWrite (8, LOW); digitalWrite (9, HIGH); //turn on the motors digitalWrite (11, HIGH); digitalWrite (10, HIGH); delay (550); //turn off the motors digitalWrite (11, LOW); digitalWrite (10, LOW); delay (1600); //******************************** //Shimmy shimmy shimmy //step backward from right digitalWrite (12, LOW); digitalWrite (13, HIGH); //turn on the motors digitalWrite (11, HIGH); delay (100); //turn off the motors digitalWrite (11, LOW); delay (115); //step backward from right digitalWrite (12, LOW); digitalWrite (13, HIGH); //turn on the motors digitalWrite (11, HIGH); delay (100); //turn off the motors digitalWrite (11, LOW); delay (115); //step backward from left digitalWrite (8, LOW); digitalWrite (9, HIGH); //turn on the motors digitalWrite (10, HIGH); delay (100); //turn off the motors digitalWrite (10, LOW); delay (115); //step backward from left digitalWrite (8, LOW); digitalWrite (9, HIGH); //turn on the motors digitalWrite (10, HIGH); delay (100); //turn off the motors digitalWrite (10, LOW); delay (115); //step backward from right digitalWrite (12, LOW); digitalWrite (13, HIGH); //turn on the motors digitalWrite (11, HIGH); delay (100); //turn off the motors digitalWrite (11, LOW); delay (115); //step backward from right digitalWrite (12, LOW); digitalWrite (13, HIGH); //turn on the motors digitalWrite (11, HIGH); delay (100); //turn off the motors digitalWrite (11, LOW); delay (115); //step backward from left digitalWrite (8, LOW); digitalWrite (9, HIGH); //turn on the motors digitalWrite (10, HIGH); delay (100); //turn off the motors digitalWrite (10, LOW); delay (115); //step backward from left digitalWrite (8, LOW); digitalWrite (9, HIGH); //turn on the motors digitalWrite (10, HIGH); delay (100); //turn off the motors digitalWrite (10, LOW); delay (115);//step backward from right digitalWrite (12, LOW); digitalWrite (13, HIGH); //turn on the motors digitalWrite (11, HIGH); delay (100); //turn off the motors digitalWrite (11, LOW); delay (115); //step backward from right digitalWrite (12, LOW); digitalWrite (13, HIGH); //turn on the motors digitalWrite (11, HIGH); delay (100); //turn off the motors digitalWrite (11, LOW); delay (115); //step backward from left digitalWrite (8, LOW); digitalWrite (9, HIGH); //turn on the motors digitalWrite (10, HIGH); delay (100); //turn off the motors digitalWrite (10, LOW); delay (115); //step backward from left digitalWrite (8, LOW); digitalWrite (9, HIGH); //turn on the motors digitalWrite (10, HIGH); delay (100); //turn off the motors digitalWrite (10, LOW); delay (115);//step backward from right digitalWrite (12, LOW); digitalWrite (13, HIGH); //turn on the motors digitalWrite (11, HIGH); delay (100); //turn off the motors digitalWrite (11, LOW); delay (115); //step backward from right digitalWrite (12, LOW); digitalWrite (13, HIGH); //turn on the motors digitalWrite (11, HIGH); delay (100); //turn off the motors digitalWrite (11, LOW); delay (115); //step backward from left digitalWrite (8, LOW); digitalWrite (9, HIGH); //turn on the motors digitalWrite (10, HIGH); delay (100); //turn off the motors digitalWrite (10, LOW); delay (115); //step backward from left digitalWrite (8, LOW); digitalWrite (9, HIGH); //turn on the motors digitalWrite (10, HIGH); delay (100); //turn off the motors digitalWrite (10, LOW); delay (115); //********************************** //half turn, back up,spin around //half turn digitalWrite (12, HIGH); digitalWrite (13, LOW); digitalWrite (8, LOW); digitalWrite (9, HIGH); //turn on the motors digitalWrite (11, HIGH); digitalWrite (10, HIGH); delay (550); //turn off the motors digitalWrite (11, LOW); digitalWrite (10, LOW); //backup fast digitalWrite (12, LOW); digitalWrite (13, HIGH); digitalWrite (8, LOW); digitalWrite (9, HIGH); //turn on the motors digitalWrite (11, HIGH); digitalWrite (10, HIGH); delay (775); //turn off the motors digitalWrite (11, LOW); digitalWrite (10, LOW); //aaaand spin digitalWrite (12, HIGH); digitalWrite (13, LOW); digitalWrite (8, LOW); digitalWrite (9, HIGH); //turn on the motors digitalWrite (11, HIGH); digitalWrite (10, HIGH); delay (2200); //turn off the motors digitalWrite (11, LOW); digitalWrite (10, LOW); delay (550); }