This is my final project for UCSC Extension - USB Programming. It is a home monitoring program for motion and temperature and requires host-side code.

Dependencies:   C12832_lcd HomeMon LM75B MMA7660 USBDevice mbed

Files at this revision

API Documentation at this revision

Comitter:
groletter
Date:
Tue Sep 03 10:59:21 2013 +0000
Parent:
2:f6a1f96dc3cd
Child:
4:04f83503d219
Commit message:
Small bug fixes

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Tue Sep 03 08:55:16 2013 +0000
+++ b/main.cpp	Tue Sep 03 10:59:21 2013 +0000
@@ -160,20 +160,25 @@
                 if (alertState.pendMotion) {
                     alertState.pendMotion = false;
                     send_alert(MOTION);
+                    motionLED = 0;
                 }
-                else if (alertState.pendTempHi) {
+                if (alertState.pendTempHi) {
                     alertState.pendTempHi = false;
                     send_alert(TEMP_HI);
+                    tempHiLED = 0;
                 }
-                else if (alertState.pendTempLo) {
+                if (alertState.pendTempLo) {
                     alertState.pendTempLo = false;
                     send_alert(TEMP_LOW);
+                    tempLoLED = 0;
                 }
             }
             else {
                 lcd.cls();
                 lcd.locate(0,3);
                 lcd.printf("Not Connected to Host\n");
+                theTemp= get_temp();
+                lcd.printf("L=%.2f H=%.2f Temp=%.2f\n", myTemp.get_min(), myTemp.get_max(), theTemp);
                 connectionLED = 0;
             }
         }