RuiViana

Testa Step

Aug 17th, 2016
135
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. // Para mudar a sequencia, torque o numero dos ports  Ex:
  3. // #define IN1 6
  4. // #define IN2 5
  5. // #define IN3 7
  6. // #define IN4 4
  7.  
  8. // Sequencia   7 6 5 4
  9. #define IN1 7
  10. #define IN2 6
  11. #define IN3 5
  12. #define IN4 4
  13.  
  14. //------------------------------------
  15. void setup()
  16. {
  17.   pinMode(IN1, OUTPUT);
  18.   pinMode(IN2, OUTPUT);
  19.   pinMode(IN3, OUTPUT);
  20.   pinMode(IN4, OUTPUT);
  21. }
  22. //-------------------------------
  23. void loop()
  24. {
  25.   digitalWrite(IN1, HIGH);
  26.   digitalWrite(IN2, LOW);
  27.   digitalWrite(IN3, LOW);
  28.   digitalWrite(IN4, LOW);
  29.   delay(800);
  30.  
  31.   digitalWrite(IN1, LOW);
  32.   digitalWrite(IN2, HIGH);
  33.   digitalWrite(IN3, LOW);
  34.   digitalWrite(IN4, LOW);
  35.   delay(800);
  36.  
  37.   digitalWrite(IN1, LOW);
  38.   digitalWrite(IN2, LOW);
  39.   digitalWrite(IN3, HIGH);
  40.   digitalWrite(IN4, LOW);
  41.   delay(800);
  42.  
  43.   digitalWrite(IN1, LOW);
  44.   digitalWrite(IN2, LOW);
  45.   digitalWrite(IN3, LOW);
  46.   digitalWrite(IN4, HIGH);
  47.   delay(800);
  48. }
RAW Paste Data