Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Meu motor
- * Vermelho IN1
- * Laranja IN2
- * Amarelo IN3
- * Marron IN4
- */
- // UNO
- #define IN1 7
- #define IN2 6
- #define IN3 5
- #define IN4 4
- /*
- // Mega
- #define IN1 25
- #define IN2 24
- #define IN3 23
- #define IN4 22
- */
- //------------------------------------
- void setup() {
- pinMode(IN1,OUTPUT);
- pinMode(IN2,OUTPUT);
- pinMode(IN3,OUTPUT);
- pinMode(IN4,OUTPUT);
- }
- //-------------------------------
- void loop()
- {
- digitalWrite(IN1,HIGH);
- digitalWrite(IN2,LOW);
- digitalWrite(IN3,LOW);
- digitalWrite(IN4,LOW);
- delay(800);
- digitalWrite(IN1,LOW);
- digitalWrite(IN2,HIGH);
- digitalWrite(IN3,LOW);
- digitalWrite(IN4,LOW);
- delay(800);
- digitalWrite(IN1,LOW);
- digitalWrite(IN2,LOW);
- digitalWrite(IN3,HIGH);
- digitalWrite(IN4,LOW);
- delay(800);
- digitalWrite(IN1,LOW);
- digitalWrite(IN2,LOW);
- digitalWrite(IN3,LOW);
- digitalWrite(IN4,HIGH);
- delay(800);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement