Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unsigned long last = 0L;
- void setup() {
- pinMode(0, INPUT_PULLUP);
- pinMode(1, OUTPUT);
- }
- void loop() {
- unsigned long now = millis();
- if (!digitalRead(0)) {
- last = now;
- }
- digitalWrite(1, (now - last > 3000) && (now % 500 < 100));
- }
Add Comment
Please, Sign In to add comment