Created
April 24, 2015 03:33
-
-
Save rehrumesh/eaf326f15a57db9cd450 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "contiki.h" | |
#include "dev/leds.h" | |
PROCESS(blink_process, "Blink"); | |
AUTOSTART_PROCESSES(&blink_process); | |
PROCESS_THREAD(blink_process,ev,data) | |
{ | |
PROCESS_EXITHANDLER(goto exit;) | |
PROCESS_BEGIN(); | |
while(1){ | |
static struct etimer et; | |
etimer_set(&et, CLOCK_SECOND); | |
PROCESS_WAIT_EVENT_UNTIL(etimer_expired(&et)); | |
leds_on(LEDS_RED); | |
etimer_set(&et, CLOCK_SECOND); | |
PROCESS_WAIT_EVENT_UNTIL(etimer_expired(&et)); | |
leds_off(LEDS_ALL) ; | |
} | |
exit: | |
leds_off(LEDS_ALL); | |
PROCESS_END(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment