Demo for MLX90614

Dependencies:   MLX90614 mbed

Files at this revision

API Documentation at this revision

Comitter:
masrodjie
Date:
Fri May 04 07:35:07 2018 +0000
Commit message:
Initial Release

Changed in this revision

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
diff -r 000000000000 -r 9dcc95868add MLX90614.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MLX90614.lib	Fri May 04 07:35:07 2018 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/masrodjie/code/MLX90614/#933b7db866c5
diff -r 000000000000 -r 9dcc95868add main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri May 04 07:35:07 2018 +0000
@@ -0,0 +1,27 @@
+#include "mbed.h"
+#include "mlx90614.h"
+ 
+DigitalOut myled(LED1); //displays I2C wait
+I2C i2c(PB_9, PB_8);   //sda,scl
+Serial pc(USBTX, USBRX);  //serial usb config
+ 
+MLX90614 IR_thermometer(&i2c, 0x5A);
+//setup an MLX90614 using MLX90614 library from
+// http://mbed.org/users/aquahika/libraries/MLX90614/lsixz6
+ 
+float temp; //temperature in degrees C
+ 
+int main() {
+    pc.printf("START\r\n");
+    while (1) {
+        myled=1; // if led1 on - waiting on I2C
+        if (IR_thermometer.getTemp(&temp)) {
+            //gets temperature from sensor via I2C bus
+            myled=0;
+            //print temperature on PC
+            pc.printf("Temperature is %.2f degrees C\r\n",temp);
+        }
+        //wait for device to produce next temperature reading
+        wait(2);
+    }
+}
\ No newline at end of file
diff -r 000000000000 -r 9dcc95868add mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri May 04 07:35:07 2018 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/5aab5a7997ee
\ No newline at end of file