Becky Page / Mbed OS Assignment1081

Files at this revision

API Documentation at this revision

Comitter:
rebecca_page
Date:
Sun Jan 24 17:27:21 2021 +0000
Parent:
5:124172cff206
Commit message:
Revised

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Fri Jan 22 10:46:55 2021 +0000
+++ b/main.cpp	Sun Jan 24 17:27:21 2021 +0000
@@ -170,10 +170,10 @@
     }
 }
 void setActuators() {
-    if (myData.ambientTemp > myData.highTempThresh) boilerLed = false; // above upper temp thresh
-    if (myData.ambientTemp > myData.lowTempThresh) boilerLed = true; // below lower temp thresh
-    if (myData.ambientLight > myData.highLightThresh) lightingLed = false; // above upper light level thresh
-    if (myData.ambientLight > myData.lowLightThresh) lightingLed = true; // below lower light level thresh
+    if (myData.ambientLight > myData.lowLightThresh) lightingLed = true; // Light on when light level beneath thresh
+    if (myData.ambientLight > myData.highLightThresh) lightingLed = false; // Light off when light level above thresh
+    if (myData.ambientTemp > myData.lowTempThresh) lightingLed = true; // boiler on when temp below thresh
+    if (myData.ambientTemp > myData.highTempThresh) lightingLed = false; // boiler off when above thresh
 }
 void readSensors()
 {
@@ -236,7 +236,7 @@
     sprintf(buffer, "%2.1f%c ", myData.highLightThresh, 0x25);
     displayAt(47, 5, buffer);
     sprintf( buffer, "The lights are %s", lightingLed?"On ":"Off" );
-    displayAt(1, 6, buffer);
+    displayAt(1, 7, buffer);
 }
 
 void displayAt( int x, int y, char *buffer )