complete

Dependencies:   4DGL-uLCD-SE_ PinDetect SDFileSystem mbed

Fork of mythermostat by jim hamblen

Revision:
6:5ba4232c5e1c
Parent:
5:c73ebb00e86d
diff -r c73ebb00e86d -r 5ba4232c5e1c main.cpp
--- a/main.cpp	Tue Sep 06 21:36:17 2016 +0000
+++ b/main.cpp	Sun Nov 06 22:08:58 2016 +0000
@@ -1,12 +1,9 @@
-// skeleton code for ECE 2036 thermostat lab
-// code must be added by students
 #include "mbed.h"
 #include "TMP36.h"
 #include "SDFileSystem.h"
 #include "uLCD_4DGL.h"
 #include "PinDetect.h"
 #include "Speaker.h"
-// must add your new class code to the project file Shiftbrite.h
 #include "Shiftbrite.h"
 #include <math.h>
 #include <iostream>
@@ -108,33 +105,14 @@
     pb3.setSampleFrequency();
     pb4.setSampleFrequency();
     // pushbuttons now setup and running
-
-
-    // start I/O examples - DELETE THIS IN YOUR CODE..BUT WILL USE THESE I/O IDEAS ELSEWHERE
-    // since all this compiles - the needed *.h files for these are in the project
-    //
     
     printf("Hello PC World\n\r"); // need terminal application running on PC to see this output
     uLCD.printf("\n\rJoe's Thermostat\n\r"); // LCD
     mySpeaker.PlayNote(500.0, 1.0, 1.0); // Speaker buzz
-//    myShiftbrite.write( 0, 50 ,0); // Green RGB LED
-    // SD card write file example - prints error message on PC when running until SD card hooked up
-    // Delete to avoid run time error
-//    mkdir("/sd/mydir", 0777); // set up directory and permissions
-//    FILE *fp = fopen("/sd/mydir/sdtest.txt", "w"); //open SD
-//    if(fp == NULL) {
-//        error("Could not open file for write\n");
-//   }
-//    fprintf(fp, "Hello SD Card World!"); // write SD
-//   fclose(fp); // close SD card
-    //
-    // end I/O examples
-
-
-        enum Statetype { Off = 0, Heat_off, Heat_on, Cool_off, Cool_on };
-        Statetype state = Off;
-        uLCD.locate(3,6);
-        uLCD.printf("OFF         ");
+    enum Statetype { Off = 0, Heat_off, Heat_on, Cool_off, Cool_on };
+    Statetype state = Off;
+    uLCD.locate(3,6);
+    uLCD.printf("OFF         ");
     // State machine code below will need changes and additions
     while (1) {
             
@@ -313,9 +291,6 @@
                 }
         
                 wait(0.33);
-                // heartbeat LED - common debug tool
-                // blinks as long as code is running and not locked up
-                //myLED1=!myLED1;
         }
     }
 }
\ No newline at end of file