Dual DS18B20 Serial Temp logger

Dependencies:   DS1820 mbed

Fork of DS1820_HelloWorld by Erik -

Import program

00001 
00002 #include "mbed.h"
00003 #include "DS1820.h"
00004  
00005 DS1820 probeInt(A0);
00006 DS1820 probeExt(A1);
00007 Timer t;
00008 int main() {
00009      probeInt.unassignedProbe(A0);
00010      
00011      probeExt.unassignedProbe(A1);
00012      
00013      while(1) {
00014          probeInt.convertTemperature(true, DS1820::all_devices);  // Start temperature conversion
00015          printf("TempInt value=%f\r\n", probeInt.temperature());     
00016 
00017          probeExt.convertTemperature(true, DS1820::all_devices);  // Start temperature conversion
00018          printf("TempRoom value=%f\r\n", probeExt.temperature());
00019      }
00020 }
00021 
Committer:
rlanghbv
Date:
Thu Nov 23 08:27:26 2017 +0000
Revision:
6:ba8f89d2098b
Parent:
5:46e4682f9c42
Doc Update

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Sissors 0:e069f9f26768 1
Sissors 0:e069f9f26768 2 #include "mbed.h"
Sissors 0:e069f9f26768 3 #include "DS1820.h"
rlanghbv 5:46e4682f9c42 4
rlanghbv 5:46e4682f9c42 5 DS1820 probeInt(A0);
rlanghbv 5:46e4682f9c42 6 DS1820 probeExt(A1);
rlanghbv 5:46e4682f9c42 7 Timer t;
rlanghbv 5:46e4682f9c42 8 int main() {
rlanghbv 5:46e4682f9c42 9 probeInt.unassignedProbe(A0);
rlanghbv 5:46e4682f9c42 10
rlanghbv 5:46e4682f9c42 11 probeExt.unassignedProbe(A1);
rlanghbv 5:46e4682f9c42 12
rlanghbv 5:46e4682f9c42 13 while(1) {
rlanghbv 6:ba8f89d2098b 14 probeInt.convertTemperature(true, DS1820::all_devices); // Start temperature conversion
rlanghbv 5:46e4682f9c42 15 printf("TempInt value=%f\r\n", probeInt.temperature());
Sissors 0:e069f9f26768 16
rlanghbv 6:ba8f89d2098b 17 probeExt.convertTemperature(true, DS1820::all_devices); // Start temperature conversion
rlanghbv 5:46e4682f9c42 18 printf("TempRoom value=%f\r\n", probeExt.temperature());
rlanghbv 5:46e4682f9c42 19 }
rlanghbv 6:ba8f89d2098b 20 }
rlanghbv 6:ba8f89d2098b 21