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

Dependencies:   DS1820

Revision:
12:34123e51ac35
Parent:
10:739d1a7a4b1b
--- a/main.cpp	Thu Apr 04 20:48:03 2019 +0000
+++ b/main.cpp	Sun Jul 19 19:29:57 2020 +0000
@@ -22,7 +22,7 @@
     if (ds1820.begin()) {
         while (1) {
             ds1820.startConversion();   // start temperature conversion from analog to digital
-            wait(1.0);                  // let DS1820 complete the temperature conversion
+            ThisThread::sleep_for(1000);// let DS1820 complete the temperature conversion
             result = ds1820.read(temp); // read temperature from DS1820 and perform cyclic redundancy check (CRC)
             switch (result) {
                 case 0:                 // no errors -> 'temp' contains the value of measured temperature
@@ -88,7 +88,7 @@
         pc.printf("----------------\r\n");
         for (int i = 0; i < sensorsFound; i++)
             ds1820[i]->startConversion();       // start temperature conversion from analog to digital
-        wait(1.0);                              // let DS1820 sensors complete the temperature conversion
+        ThisThread::sleep_for(1000);            // let DS1820 sensors complete the temperature conversion
         for (int i = 0; i < sensorsFound; i++) {
             if (ds1820[i]->isPresent())
                 pc.printf("temp[%d] = %3.1f%cC\r\n", i, ds1820[i]->read(), 176); // read temperature