Project aiming to make a self-controlled solar reflector

Dependencies:   Accelerometer LCD Inverter Algorithm MotorDriver Anemometer GUI ArduinoJson Misc Definitions Pushbutton WebSocketClient temp_fan

Files at this revision

API Documentation at this revision

Comitter:
khaiminhvn
Date:
Thu Apr 15 18:47:41 2021 +0000
Parent:
34:05769d24d810
Commit message:
Added power halting threshold

Changed in this revision

Definitions.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/Definitions.lib	Tue Apr 06 22:25:14 2021 +0000
+++ b/Definitions.lib	Thu Apr 15 18:47:41 2021 +0000
@@ -1,1 +1,1 @@
-https://os.mbed.com/users/khaiminhvn/code/Definitions/#79b3e4c9fea4
+https://os.mbed.com/users/khaiminhvn/code/Definitions/#0dc15f403424
--- a/main.cpp	Tue Apr 06 22:25:14 2021 +0000
+++ b/main.cpp	Thu Apr 15 18:47:41 2021 +0000
@@ -60,6 +60,7 @@
 bool flag_aTrack; //Flag for active tracking (0 - offline, 1 - online)
 bool flag_powerOn = true;
 float sun_angle;
+int pow;
 
 //PUSHBUTTONS
 Pushbutton bt_inc(PIN_BTINC);
@@ -178,6 +179,11 @@
                 lcd.LCD_display(topL,botL);
             }
             
+            pow = (flag_eth) ? inverter->getPower() : -1;
+            if(pow == -1 || pow > THRESHOLD_PER*MAX_POWER){
+                break;
+            }
+            
             if(flag_time) //If delay interval has passed
             {
                 ane.checkWind(&mode);