Simple DS1820 sensor demo showing how to use the DS1820 library [https://developer.mbed.org/users/hudakz/code/DS1820/]

Dependencies:   DS1820 mbed

Fork of DS1820_Hello by Zoltan Hudak

Revision:
4:9afd6251d15e
Parent:
3:eb195375cde7
--- a/main.cpp	Fri Mar 27 12:37:34 2015 +0000
+++ b/main.cpp	Wed Nov 01 02:29:37 2017 +0000
@@ -9,6 +9,9 @@
 #include "mbed.h"
 #include "DS1820.h"
 
+DigitalOut ledpin(LED1); 
+DigitalIn  sensor_in(D4);
+
 Serial serial(USBTX, USBRX);
  
 int main() {
@@ -24,9 +27,26 @@
         }
     } else
         serial.printf("No DS1820 sensor found!\r\n");
+
+      
+    while(1) {
+        // LEDs are ON
+        if(sensor_in)
+        {
+            ledpin = 1;
+            serial.printf("LED:ON\n");     
+            wait(1.2);
+        }
+        else
+        {
+        // LEDs are OFF
+            ledpin = 0;
+           serial.printf("LED:OFF\n");
+            wait(1.4);
+        }
+  }
 }
 
-
 // You can create an array of sensors:
 
 //int main() {