Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int motorPin1 = 8;
- int motorPin2 = 9;
- int motorPin3 = 10;
- int motorPin4 = 11;
- int delayTime = 100;
- void setup() {
- Serial.begin(9600);
- pinMode(motorPin1, OUTPUT);
- pinMode(motorPin2, OUTPUT);
- pinMode(motorPin3, OUTPUT);
- pinMode(motorPin4, OUTPUT);
- }
- void loop() {
- digitalWrite(motorPin1, HIGH);
- digitalWrite(motorPin2, LOW);
- digitalWrite(motorPin3, LOW);
- digitalWrite(motorPin4, LOW);
- delay(delayTime);
- digitalWrite(motorPin1, LOW);
- digitalWrite(motorPin2, LOW);
- digitalWrite(motorPin3, HIGH);
- digitalWrite(motorPin4, LOW);
- delay(delayTime);
- digitalWrite(motorPin1, LOW);
- digitalWrite(motorPin2, HIGH);
- digitalWrite(motorPin3, LOW);
- digitalWrite(motorPin4, LOW);
- delay(delayTime);
- digitalWrite(motorPin1, LOW);
- digitalWrite(motorPin2, LOW);
- digitalWrite(motorPin3, LOW);
- digitalWrite(motorPin4, HIGH);
- delay(delayTime);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement