32 #include "dev/button-sensor.h"
33 #include "dev/pir-sensor.h"
34 #include "dev/vib-sensor.h"
38 PROCESS(test_sensors_process,
"Test sensors process");
39 AUTOSTART_PROCESSES(&test_sensors_process);
45 printf(
"Starting sensors test process\n");
46 button_sensor.configure(SENSORS_ACTIVE, 1);
47 pir_sensor.configure(SENSORS_ACTIVE, 1);
48 vib_sensor.configure(SENSORS_ACTIVE, 1);
53 if (ev == sensors_event) {
54 if (data == &button_sensor) {
56 }
else if (data == &vib_sensor) {
57 printf(
"Vibration sensor\n");
58 }
else if (data == &pir_sensor) {
59 printf(
"Passive IR sensor\n");
61 printf(
"Unknown sensor\n");
64 printf(
"Non-sensor event triggered\n");
#define PROCESS_BEGIN()
Define the beginning of a process.
#define PROCESS_THREAD(name, ev, data)
Define the body of a process.
#define PROCESS_END()
Define the end of a process.
#define PROCESS_WAIT_EVENT()
Wait for an event to be posted to the process.
#define PROCESS(name, strname)
Declare a process.