Keep changing the numbers in the first four lines around until you get the robot wheels to go in the following order:
Right forward
Right reverse
Left forward
Left reverse
1234567
intright_forward=5;intright_reverse=3;intleft_forward=6;intleft_reverse=9;intdelay_time_on=2000;// how long should each wheel turn?intdelay_time_off=1000;// delay between testsintdelay_end_of_test=3000;// delay between tests
Here is our setup code:
1 2 3 4 5 6 7 8 9101112131415
voidsetup(){// Turn these pins on for PWM OUTPUTpinMode(right_forward,OUTPUT);pinMode(right_reverse,OUTPUT);pinMode(left_forward,OUTPUT);pinMode(left_reverse,OUTPUT);// turn all the motors offdigitalWrite(right_forward,LOW);digitalWrite(right_reverse,LOW);digitalWrite(left_forward,LOW);digitalWrite(left_reverse,LOW);// for debugging. The output will appear on the serial monitor// To open the serial monitor, click the magnafing glass icon in the upper right cornerSerial.begin(9600);// open the serial port at 9600 bps}