Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define led1 4 // Port para o led1
- #define led2 5 // Port para o led2
- #define led3 6 // Port para o led3
- //-------------------------------------------------------------------------
- void setup()
- {
- Serial.begin(9600); // Inicialisa o Monitor serial
- }
- //-------------------------------------------------------------------------
- void LigaLed(byte Qled, unsigned int Tempo1,unsigned int Tempo2)
- {
- Serial.println("liga");
- digitalWrite(Qled, HIGH);
- delay(Tempo1);
- Serial.println("deslig");
- digitalWrite(Qled, LOW);
- delay(Tempo2);
- }
- //-------------------------------------------------------------------------
- void loop()
- {
- if ((((now.hour() == horaliga1) || (now.hour() == horaliga2)) && (now.minute() == minlig) && (now.second() <= 2))) // hora da ação
- { // 1
- LigaLed(led1,500,1000); // Chama a função LigaLed informando led, temp de ligado e tempo de desliogado
- LigaLed(led2,500,1000);
- LigaLed(led3,500,1000);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement