Question

I would like to know which library should I use to manipulate mote leds.

I tried to use Led Contiki Module but I don't know which header file include.

Is there someone who can help me ?

Was it helpful?

Solution

Look in the platform-conf.h in eg contiki/platform/sky/. There you'll find the definitions you can use, of eg LEDS_RED.

Then, in your application,

#include "leds.h"
...
leds_on(LEDS_RED);
leds_off(LEDS_GREEN);
leds_toggle(LEDS_RED);
leds_off(LEDS_ALL);

You can look in leds-arch.h to see how the implementations sets/get LED state.

OTHER TIPS

e.g. at contiki-2.7/core/dev you can find leds.c and leds.h.

In leds.c are implemented functions for accessing LEDs, e.g. leds_on(...), leds_off(...).

In leds.h are inter alia specified names of LEDs and their number values, e.g. #define LEDS_GREEN 1

To your question: #include "dev/leds.h"

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top