- void pushButton()
- {
- static unsigned long last_interrupt_time = 0;
- unsigned long interrupt_time = millis();
- // If interrupts come faster than 200ms, assume it's a bounce and ignore
- if (interrupt_time - last_interrupt_time > 200)
- {
- Serial.print("Button\n");
- }
- last_interrupt_time = interrupt_time;
- }
|