Advertisement
RuiViana

Testa Step Com ULN2003

Nov 8th, 2015
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. /*
  2. * Meu motor
  3. * Vermelho IN1
  4. * Laranja IN2
  5. * Amarelo IN3
  6. * Marron IN4
  7. */
  8. // UNO
  9. #define IN1 7
  10. #define IN2 6
  11. #define IN3 5
  12. #define IN4 4
  13. /*
  14. // Mega
  15. #define IN1 25
  16. #define IN2 24
  17. #define IN3 23
  18. #define IN4 22
  19. */
  20. //------------------------------------
  21. void setup() {
  22. pinMode(IN1,OUTPUT);
  23. pinMode(IN2,OUTPUT);
  24. pinMode(IN3,OUTPUT);
  25. pinMode(IN4,OUTPUT);
  26. }
  27. //-------------------------------
  28. void loop()
  29. {
  30. digitalWrite(IN1,HIGH);
  31. digitalWrite(IN2,LOW);
  32. digitalWrite(IN3,LOW);
  33. digitalWrite(IN4,LOW);
  34. delay(800);
  35.  
  36. digitalWrite(IN1,LOW);
  37. digitalWrite(IN2,HIGH);
  38. digitalWrite(IN3,LOW);
  39. digitalWrite(IN4,LOW);
  40. delay(800);
  41.  
  42. digitalWrite(IN1,LOW);
  43. digitalWrite(IN2,LOW);
  44. digitalWrite(IN3,HIGH);
  45. digitalWrite(IN4,LOW);
  46. delay(800);
  47.  
  48. digitalWrite(IN1,LOW);
  49. digitalWrite(IN2,LOW);
  50. digitalWrite(IN3,LOW);
  51. digitalWrite(IN4,HIGH);
  52. delay(800);
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement