diff --git a/config.h b/config.h index 1e0560d..2ac8fd6 100644 --- a/config.h +++ b/config.h @@ -7,12 +7,18 @@ // Times in ms #define PULSE_DURATION 30 -#define DEBOUNCE_TIME 100 +#define DEBOUNCE_TIME 50 // was 100 // RISING, FALLING, EITHER #define TRIGGER_TYPE RISING +// RISING = being disconnected +// FALLING = being connected // If defined, active low, else active high #define OFF_HIGH -#endif +// Pull-up resistor configuration +// Enable or disable the internal pull-up resistor for the input pin +#define PULLUP_ENABLED 1 + +#endif /* __CONFIG_H__ */ diff --git a/main.c b/main.c index ea7c20b..0d7271f 100644 --- a/main.c +++ b/main.c @@ -91,7 +91,13 @@ int main() { cbi(PORTB, OUTPUT_PIN); #endif - while(1) { sleep(); }; +#ifdef PULLUP_ENABLED + sbi(PORTB, INPUT_PIN); +#endif + + while (1) { + sleep(); + }; return 0; }