Alexander Lang
/
Genie_Test_Temperature
a quick program to test the 4Dgenie library
Fork of Genie_Test by
Diff: main.cpp
- Revision:
- 0:f065693322dd
- Child:
- 1:203466f6d54f
diff -r 000000000000 -r f065693322dd main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Nov 18 02:39:18 2013 +0000 @@ -0,0 +1,51 @@ +#include "mbed.h" +#include "mbed_genie.h" +DigitalOut myled(LED1); +void myGenieEventHandler(void) +{ + genieFrame Event; + genieDequeueEvent(&Event); + //event report from an object + if(Event.reportObject.cmd == GENIE_REPORT_EVENT) + { + if (Event.reportObject.object == GENIE_OBJ_4DBUTTON) // If the Reported Message was from a Slider + { + if (Event.reportObject.index == 0) + { + printf("Button 1 pressed!\n\r"); + } + if (Event.reportObject.index == 1) + { + printf("Button 2 pressed!\n\r"); + } + if (Event.reportObject.index == 2) + { + printf("Button 3 pressed!\n\r"); + } + } + } + //Cmd from a reported object (happens when an object read is requested) + if(Event.reportObject.cmd == GENIE_REPORT_OBJ) + { + + } + + +} + +int main() { + +SetupGenie(); +genieAttachEventHandler(&myGenieEventHandler); +//Write a string to the Display + genieWriteStr(0, GENIE_VERSION); + + + while(1) { + + myled = 1; + wait(0.2); + myled = 0; + wait(0.2); + } +}