Project aiming to make a self-controlled solar reflector
Dependencies: Accelerometer LCD Inverter Algorithm MotorDriver Anemometer GUI ArduinoJson Misc Definitions Pushbutton WebSocketClient temp_fan
Diff: main.cpp
- Revision:
- 23:5dff9aed3727
- Parent:
- 22:6c8535dab84a
- Child:
- 24:ea7abc25a697
diff -r 6c8535dab84a -r 5dff9aed3727 main.cpp --- a/main.cpp Wed Mar 24 23:17:31 2021 +0000 +++ b/main.cpp Wed Mar 24 23:44:48 2021 +0000 @@ -587,6 +587,34 @@ break; } //////////////////////////////////////////////////////////////////////// + case OP_RECONNECT:{ + topL = "CONNECTING"; + botL = ""; + lcd.LCD_display(topL,botL); + eth.connect(); + gui.refreshConnection(&flag_eth); + inverter.connect(URL, PORT); + bt_fn.setConnected(flag_eth); + wait_us(1000000); + + if (flag_eth){gui.getSunAngle();} + if (flag_eth){ + topL = "ETHERNET"; + botL = "CONNECTED"; + lcd.LCD_display(topL, botL); + } + else{ + topL = "ETHERNET"; + botL = "NOT CONNECTED"; + lcd.LCD_display(topL, botL); + } + wait_us(TIME_RECONNECT_TIMEOUT); + + mode = OP_NORMAL; + flag_time = 1; //Set the system in motion once done adjusting + break; + } + //////////////////////////////////////////////////////////////////////// } if (flag_eth){