5 #include "lib/sensors.h"
6 #include "dev/button-sensor.h"
8 #include <avr/interrupt.h>
9 const struct sensors_sensor button_sensor;
10 static int status(
int type);
11 static struct timer debouncetimer;
16 sensors_changed(&button_sensor);
24 return 1-((PINB & (1<<PB2))>>PB2) || !
timer_expired(&debouncetimer);
28 configure(
int type,
int c)
33 if(!status(SENSORS_ACTIVE)) {
58 return ~(DDRB & (1<<PB2));
64 SENSORS_SENSOR(button_sensor, BUTTON_SENSOR,
65 value, configure, status);