christian b
/
Genie_Test
Simple port of the 4d genie arduino code. Works, but needs more work to be fully functionnal as a class!
Diff: main.cpp
- Revision:
- 2:e0f7812d4524
- Parent:
- 1:203466f6d54f
- Child:
- 3:4fe144f2f64e
diff -r 203466f6d54f -r e0f7812d4524 main.cpp --- a/main.cpp Mon Nov 18 03:04:46 2013 +0000 +++ b/main.cpp Wed Nov 20 22:47:46 2013 +0000 @@ -1,5 +1,20 @@ #include "mbed.h" #include "mbed_genie.h" +#include "WiflyInterface.h" +/* + For Now, the 4d Screen Genie is hard coded to operate on the uart connected at pins p9 and p10 + Further improvements would be to make to turn it into a class that could be instantiated to any + or the Mbed uarts -> TODO +*/ +/* wifly object where: +* - p13 and p14 are for the serial communication +* - p25 is for the reset pin +* - p26 is for the connection status +* - "mbed" is the ssid of the network +* - "password" is the password +* - WPA is the security +*/ +WiflyInterface wifly(p13, p14, p25, p26, "Bibite", "DIR825Chris24", WPA); DigitalOut myled(LED1); void myGenieEventHandler(void) { @@ -34,14 +49,21 @@ } int main() { +SetupGenie(); +genieAttachEventHandler(&myGenieEventHandler); +genieWriteContrast(0); +wifly.init(); // use DHCP +while (!wifly.connect()); // join the network + printf("IP Address is %s\n\r", wifly.getIPAddress()); printf("Mbed Genie demo \n\r"); -SetupGenie(); -genieAttachEventHandler(&myGenieEventHandler); +genieWriteContrast(1); //Write a string to the Display - genieWriteStr(0, GENIE_VERSION); + genieWriteStr(0, __DATE__" " __TIME__); + genieWriteStr(1, wifly.getIPAddress()); + genieWriteStr(2, "Mbed Genie Test and developement"); while(1) {