Skeleton program for Federico's 4YP project.
Dependencies: WebSocketClient WiflyInterface mbed messages
Fork of IoT_Ex by
Diff: source/globals.cpp
- Revision:
- 3:f20e114eb2ee
- Parent:
- 2:7abdaa5a9209
- Child:
- 5:0c7d131e6089
--- a/source/globals.cpp Tue Oct 04 13:59:13 2016 +0000 +++ b/source/globals.cpp Tue Oct 04 16:20:14 2016 +0000 @@ -23,7 +23,7 @@ Timer DisplayTimer; DigitalOut Led(LED1); -WiflyInterface eth(D8, D2, D6, LED1, wifissid, wifipassword, WPA2); +WiflyInterface eth(D8, D2, D6, D5, wifissid, wifipassword, WPA2); int ReconnectAttempts = 0; int SendCounter = 0; @@ -140,10 +140,7 @@ INFO("Received: %s", msg_buffer); sscanf(msg_buffer, "%d,%s", wifi_cmd, msg_buffer2); if(*wifi_cmd == CHANGEVAR_WIFI_CMD){ - // Get two more values: - sscanf(msg_buffer2, "%d,%f", var, value); - }else{ - // Get one: + // Get one more value: sscanf(msg_buffer2, "%f", value); } }else if(resp == -1){ @@ -163,7 +160,11 @@ // modifies something in the SCS Controller: switch(wifi_var){ case CV_LED: - + if(wifi_data > 0){ + Led = 1; + }else{ + Led = 0; + } break; default: