Hi this code is 2 motors; each moves forward for 1 second..then it stops for a random duration of 0.5 to 3 seconds
Not sure if it works; I will try it soon...any comments please reply
// 2 motors move for 1 sec and then stop for randomly 0.5-3 seconds.
int MotPin1 = 9; // select pin 9 for Motor1
int MotPin2 = 10; // select pin 10 for Motor2
void setup () {
pinMode(MotPin1, OUTPUT); // MotPin1 should be output
pinMode(MotPin2, OUTPUT); // MotPin2 should be output
}
void loop () {
digitalWrite(MotPin1, 1); // Motor1 ON
delay(1000)
digitalWrite(MotPin1, 0); // Motor1 OFF
delay(random(500,3000)); // delay for random time
digitalWrite(MotPin2, 1); // Motor2 ON
delay(1000)
digitalWrite(MotPin2, 0); // Motor2 OFF
delay(random(500,3000)); // delay for random time
}