MLX90614 Basic Code

Dependencies:   MLX90614 mbed

Revision:
0:29adb7b2a6e3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed May 03 13:08:46 2017 +0000
@@ -0,0 +1,16 @@
+#include "mbed.h"
+#include "mlx90614.h"
+
+I2C i2c(p28,p27);   //sda,scl
+MLX90614 thermometer(&i2c);
+Serial pc(USBTX,USBRX);
+float temp;
+
+int main()
+{
+    if(thermometer.getTemp(&temp)) {
+        pc.printf("Temperature : %f \r\n",temp);
+    }
+    wait(0.5);
+
+}
\ No newline at end of file