Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: Accelerometer LCD Inverter Algorithm MotorDriver Anemometer GUI ArduinoJson Misc Definitions Pushbutton WebSocketClient temp_fan
Diff: main.cpp
- Revision:
- 25:b04abb0930ef
- Parent:
- 24:ea7abc25a697
- Child:
- 26:b30a61a55b2f
diff -r ea7abc25a697 -r b04abb0930ef main.cpp
--- a/main.cpp Thu Mar 25 00:47:25 2021 +0000
+++ b/main.cpp Thu Mar 25 01:17:46 2021 +0000
@@ -131,7 +131,8 @@
topL = "NORMAL:IDLING";
topL = (flag_aTrack) ? topL : "*" + topL;
if(timer_read_ms(t_disp) >= LCD_RRATE){
- botL = Misc::itos(ane.getWind(&flag_disp),3) + "kph | " + Misc::itos(fan.getTemp()) + "C";
+ botL = Misc::itos(ane.getWind(&flag_disp)) + "kph*" + Misc::itos(fan.getTemp()) + "C*"
+ + ((flag_eth)?Misc::itos(inverter.getPower()):"---") + "W";
t_disp.reset();
t_disp.start();
}
@@ -167,7 +168,8 @@
topL = (flag_flas)? "NORMAL:R1 <=>" : "NORMAL:R1 <-=->";
topL = (flag_aTrack) ? topL : "*" + topL;
flag_flas = !flag_flas;
- botL = Misc::itos(ane.getWind(&flag_disp),3) + "kph | " + Misc::itos(fan.getTemp()) + "C";
+ botL = Misc::itos(ane.getWind(&flag_disp)) + "kph*" + Misc::itos(fan.getTemp()) + "C*"
+ + ((flag_eth)?Misc::itos(inverter.getPower()):"---") + "W";
t_disp.reset();
t_disp.start();
}
@@ -185,7 +187,8 @@
topL = (flag_flas)? "NORMAL:R1 > = < " : "NORMAL:R1 ->=<-";
topL = (flag_aTrack) ? topL : "*" + topL;
flag_flas = !flag_flas;
- botL = Misc::itos(ane.getWind(&flag_disp),3) + "kph | " + Misc::itos(fan.getTemp()) + "C";
+ botL = Misc::itos(ane.getWind(&flag_disp)) + "kph*" + Misc::itos(fan.getTemp()) + "C*"
+ + ((flag_eth)?Misc::itos(inverter.getPower()):"---") + "W";
t_disp.reset();
t_disp.start();
}
@@ -207,7 +210,8 @@
topL = (flag_flas)? "NORMAL:R2 <=>" : "NORMAL:R2 <-=->";
topL = (flag_aTrack) ? topL : "*" + topL;
flag_flas = !flag_flas;
- botL = Misc::itos(ane.getWind(&flag_disp),3) + "kph | " + Misc::itos(fan.getTemp()) + "C";
+ botL = Misc::itos(ane.getWind(&flag_disp)) + "kph*" + Misc::itos(fan.getTemp()) + "C*"
+ + ((flag_eth)?Misc::itos(inverter.getPower()):"---") + "W";
t_disp.reset();
t_disp.start();
}
@@ -225,7 +229,8 @@
topL = (flag_flas)? "NORMAL:R2 > = < " : "NORMAL:R2 ->=<-";
topL = (flag_aTrack) ? topL : "*" + topL;
flag_flas = !flag_flas;
- botL = Misc::itos(ane.getWind(&flag_disp),3) + "kph | " + Misc::itos(fan.getTemp()) + "C";
+ botL = Misc::itos(ane.getWind(&flag_disp)) + "kph*" + Misc::itos(fan.getTemp()) + "C*"
+ + ((flag_eth)?Misc::itos(inverter.getPower()):"---") + "W";
t_disp.reset();
t_disp.start();
}
@@ -252,7 +257,8 @@
if(timer_read_ms(t_disp) >= LCD_RRATE){
topL = (flag_flas)? "WIND SAFETY *!*" : "WIND SAFETY";
flag_flas = !flag_flas;
- botL = Misc::itos(ane.getWind(&flag_disp),3) + "kph | " + Misc::itos(fan.getTemp()) + "C";
+ botL = Misc::itos(ane.getWind(&flag_disp)) + "kph*" + Misc::itos(fan.getTemp()) + "C*"
+ + ((flag_eth)?Misc::itos(inverter.getPower()):"---") + "W";
t_disp.reset();
t_disp.start();
}
@@ -598,7 +604,7 @@
botL = "";
lcd.LCD_display(topL,botL);
eth.connect();
- gui.refreshConnection(&flag_eth);
+ gui.refreshConnection(URL,&flag_eth);
inverter.connect(URL, PORT);
bt_fn.setConnected(flag_eth);
wait_us(1000000);
