mDot project for Multitech and Explora worhshop
Dependencies: mDot_X_NUCLEO_IKS01A1 libmDot-dev-mbed5-deprecated
Fork of mDot-IKS01A1 by
Diff: RadioEvent.h
- Revision:
- 12:3466445b1ac6
- Parent:
- 0:9e88a9018fc0
diff -r 1425f2e65663 -r 3466445b1ac6 RadioEvent.h --- a/RadioEvent.h Tue Feb 14 20:36:21 2017 +0000 +++ b/RadioEvent.h Mon Jun 26 17:22:52 2017 +0000 @@ -1,9 +1,9 @@ #ifndef __RADIO_EVENT_H__ #define __RADIO_EVENT_H__ - +#include "mbed.h" #include "dot_util.h" #include "mDotEvent.h" - +extern DigitalOut MyLed; class RadioEvent : public mDotEvent { @@ -69,6 +69,15 @@ // print RX data as string std::string rx((const char*)info->RxBuffer, info->RxBufferSize); printf("Rx data: %s\r\n", rx.c_str()); + if(strcmp(rx.c_str(),"on")==0) + { + printf("Turning Led ON\r\n"); + MyLed = 0; + }else + { + printf("Turning Led OFF\r\n"); + MyLed = 1; + } } } }