Guest User

Untitled

a guest
Mar 20th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. unsigned long last = 0L;
  2.  
  3. void setup() {
  4. pinMode(0, INPUT_PULLUP);
  5. pinMode(1, OUTPUT);
  6. }
  7.  
  8. void loop() {
  9. unsigned long now = millis();
  10. if (!digitalRead(0)) {
  11. last = now;
  12. }
  13. digitalWrite(1, (now - last > 3000) && (now % 500 < 100));
  14. }
Add Comment
Please, Sign In to add comment