719de36b1bc14002f65082a12f2a879dc6200c9e
4 #include <dev/button-sensor.h>
6 PROCESS(ledbuttontest
, "LED button test");
7 AUTOSTART_PROCESSES(&ledbuttontest
);
9 PROCESS_THREAD(ledbuttontest
, ev
, data
) {
15 SENSORS_ACTIVATE(button_sensor
);
18 static struct etimer timer
;
20 PROCESS_WAIT_EVENT_UNTIL(ev
== sensors_event
&& data
== &button_sensor
);
22 // debounce for 250 ms
23 etimer_set(&timer
, CLOCK_SECOND
* 0.25);
24 PROCESS_WAIT_EVENT_UNTIL(etimer_expired(&timer
));
27 leds_toggle(LEDS_GREEN
);
29 leds_toggle(LEDS_YELLOW
);
30 //printf("toggled\n");
This page took 0.046554 seconds and 3 git commands to generate.