TX for Temperature Controlled Fan

Dependencies:   4DGL-uLCD-SE MLX90614 mbed

Files at this revision

API Documentation at this revision

Comitter:
TimothyY
Date:
Fri Apr 29 01:08:48 2016 +0000
Commit message:
TxFinal

Changed in this revision

4DGL-uLCD-SE.lib Show annotated file Show diff for this revision Revisions of this file
MLX90614.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
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/4DGL-uLCD-SE.lib	Fri Apr 29 01:08:48 2016 +0000
@@ -0,0 +1,1 @@
+https://mbed.org/users/4180_1/code/4DGL-uLCD-SE/#e39a44de229a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MLX90614.lib	Fri Apr 29 01:08:48 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/aquahika/code/MLX90614/#dcd4fe76bd13
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Apr 29 01:08:48 2016 +0000
@@ -0,0 +1,51 @@
+#include "mbed.h"
+#include "mlx90614.h"
+#include "uLCD_4DGL.h"
+
+I2C i2c(p28,p27);   //sda,scl
+
+MLX90614 IR_thermometer(&i2c);
+//setup an MLX90614 using MLX90614 library from
+// http://mbed.org/users/aquahika/libraries/MLX90614/lsixz6
+
+DigitalIn sw(p20);
+
+Serial pc(USBTX, USBRX);
+
+Serial xbee1(p9,p10);
+
+uLCD_4DGL uLCD(p13,p14,p11);
+
+DigitalOut myled(LED1);
+DigitalOut myled3(LED3);//Create variable for Led 3 on the mbed
+
+int main() {
+    
+    sw.mode(PullUp);
+    
+    float current_temp = 0.0;
+    
+    wait(5.0);
+    uLCD.printf("Your temp is:");
+    while (1) {
+        wait(1.0);
+        myled=1; // if led1 on - waiting on I2C
+        if (IR_thermometer.getTemp(&current_temp)) {
+        //gets temperature from sensor via I2C bus
+       
+        if (sw == 1) {
+            xbee1.printf("%d \n\r", (int) current_temp);
+        }
+        //pc.printf("data %d \n\r", (int) current_temp);
+        myled=0;
+        uLCD.text_height(3);
+        uLCD.text_width(3);
+        uLCD.locate(1,2);
+        uLCD.printf("%d C", (int) current_temp);
+        wait(0.3);
+        myled3=1;
+        wait(1.0); 
+        //wait for device to produce next temperature reading        
+        }
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri Apr 29 01:08:48 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/082adc85693f
\ No newline at end of file