![](/media/cache/profiles/06833b73c7b85d172f55b6f38a40b094.jpg.50x50_q85.jpg)
a quick program to test the 4Dgenie library
Fork of Genie_Test by
main.cpp
- Committer:
- chris215
- Date:
- 2013-11-18
- Revision:
- 0:f065693322dd
- Child:
- 1:203466f6d54f
File content as of revision 0:f065693322dd:
#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); } }