void setup() { pinMode(2, OUTPUT); pinMode(3, OUTPUT); } void loop() { // speed 0-255 //1.forward--------- analogWrite(5, 100);//speed 200 digitalWrite(2, LOW); digitalWrite(3, HIGH); delay(5000);//5sec //1.forward--------- //2.back----------- analogWrite(5, 100);//speed 100 digitalWrite(2, HIGH); digitalWrite(3, LOW); delay(3000);//3sec //2.back----------- //3.forward------- analogWrite(5, 200);//speed 200 digitalWrite(2, LOW); digitalWrite(3, HIGH); delay(5000);//5sec //3.forward------- //4..... }