Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define btdescargabaixa 6
- unsigned long tempo = 0;
- //-------------------------------------------
- void setup() {
- pinMode(btdescargabaixa, INPUT);
- pinMode(5, OUTPUT);
- tempo = millis();
- }
- //-------------------------------------------
- void loop() {
- while (digitalRead (btdescargabaixa) == HIGH)
- {
- if (millis() - tempo >= 3000)
- {
- digitalWrite (5, LOW);
- }
- else
- {
- digitalWrite (5, HIGH);
- }
- }
- if(digitalRead (btdescargabaixa) == LOW)
- {
- digitalWrite (5, LOW);
- tempo = millis();
- }
- }
Add Comment
Please, Sign In to add comment