RuiViana

Teste_C_Delay

Jul 12th, 2016
129
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #define PIN_LED_A 12 // Pino do LedA
  2. #define PIN_LED_B 13 // Pino do LedB
  3. bool EstadoLedA = 0; // Estado atual do LedA
  4. bool EstadoLedB = 0; // Estado atual do LedB
  5. //-------------------------------------
  6. void setup() {
  7.  
  8. pinMode(PIN_LED_A, OUTPUT); // Pino do Led A = saida
  9. pinMode(PIN_LED_B, OUTPUT); // Pino do Led B = saida
  10. digitalWrite(PIN_LED_A , LOW);
  11. digitalWrite(PIN_LED_B , LOW);
  12. }
  13. //--------------------------------------
  14. void loop()
  15. {
  16. EstadoLedA = !EstadoLedA;
  17. digitalWrite(PIN_LED_A , EstadoLedA);
  18. delay(20);
  19. EstadoLedB = !EstadoLedB;
  20. digitalWrite(PIN_LED_B , EstadoLedB);
  21. delay(20);
  22. }
RAW Paste Data