p { margin-bottom: 0.25cm; line-height: 120%; }a:link { }
#include "contiki.h"
#include "dev/button-sensor.h"
#include "dev/leds.h"
#include "dev/gpios.h"
#include <stdio.h>
#include "board.h"
/*---------------------------------------------------------------------------*/
PROCESS(test_button_process, "Test button");
AUTOSTART_PROCESSES(&test_button_process);
/*---------------------------------------------------------------------------*/
PROCESS_THREAD(test_button_process, ev, data)
{
PROCESS_BEGIN();
SENSORS_ACTIVATE(button_sensor);
boardPrintStringDescription();
printf("Press the button to toggle the leds.");
while(1)
{
PROCESS_WAIT_EVENT_UNTIL(ev == sensors_event && data == &button_sensor);
leds_toggle(LEDS_ALL);
gpios_toggle(GPIOS_RELAY);
(I want to add the statement here which indicate that the output of the gpio is 3.3v)
}
PROCESS_END();
}
/*--------------------------------