Daiki Morita
/
2017-07-05-22-56
all publish
Diff: main.cpp
- Revision:
- 0:e8affd8e420a
diff -r 000000000000 -r e8affd8e420a main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon May 06 00:21:44 2019 +0000 @@ -0,0 +1,23 @@ +#include "mbed.h" +#define NOD 3 +char rx_buffer[NOD]; +Serial xbee(D1,D0,9600); +DigitalOut myled(LED1); + +const event_callback_t callbackr() +{ +} +public void rx_callback() +{ + xbee.read(rx_buffer,NOD,&callbackr); +} +int main() +{ + xbee.attach(&rx_callback); + while(1) { + myled = 1; // LED is ON + wait(0.2); // 200 ms + myled = 0; // LED is OFF + wait(1.0); // 1 sec + } +}