GSOE Belueftung DS18B20
Dependencies: LCD_i2c_GSOE DS1820
Revision 2:a680194ce6df, committed 2015-03-26
- Comitter:
- hudakz
- Date:
- Thu Mar 26 21:12:05 2015 +0000
- Parent:
- 1:fe12bf2ad337
- Child:
- 3:eb195375cde7
- Commit message:
- Sample of sensor array corrected.
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Thu Mar 26 20:58:32 2015 +0000 +++ b/main.cpp Thu Mar 26 21:12:05 2015 +0000 @@ -15,8 +15,8 @@ DS1820 ds1820(PA_9); // substitute PA_9 with actual mbed pin name connected to the DS1820 data pin if(ds1820.begin()) { - ds1820.startConversion(); - wait(1.0); + ds1820.startConversion(); // start temperature conversion + wait(1.0); // let DS1820 complete the temperature conversion while(1) { serial.printf("temp = %3.1f\r\n", ds1820.read()); // read temperature ds1820.startConversion(); // start temperature conversion @@ -37,14 +37,14 @@ // serial.printf("Couldn't find sensor %d", i); // } else // ds1820[i].startConversion(); -// } -// -// wait(1.0); // let DS1820s complete the temperature conversion -// +// } +// wait(1.0); // let DS1820s complete the temperature conversion // while(1) { // for(int i = 0; i < 3; i++) { -// serial.printf("temp%d = %3.1f\r\n", i, ds1820[i].read()); // read temperature -// ds1820[i].startConversion(); // start temperature conversion +// if(ds1820[i].present) { +// serial.printf("temp%d = %3.1f\r\n", i, ds1820[i].read()); // read temperature +// ds1820[i].startConversion(); // start temperature conversion +// } // } // wait(1.0); // let DS1820s complete the temperature conversion // }