ds18b20 for senior design
Dependencies: mbed
Fork of ds18b20_test by
Diff: main.cpp
- Revision:
- 2:b369cd116bf1
- Parent:
- 1:10bbb8a13329
diff -r 10bbb8a13329 -r b369cd116bf1 main.cpp --- a/main.cpp Thu Mar 27 17:26:59 2014 +0000 +++ b/main.cpp Tue Nov 17 21:55:04 2015 +0000 @@ -3,8 +3,8 @@ Serial pc(SERIAL_TX, SERIAL_RX); -const int MAX_PROBES = 3; -DS1820 probe[3] = {D2, D2, D2}; +const int MAX_PROBES = 1; +DS1820 probe[1] = {A0}; int main() @@ -31,8 +31,8 @@ while(1) { probe[0].convert_temperature(DS1820::all_devices); for (i=0; i<devices_found; i++) { - pc.printf("Device[%d]: %3.1f \r\n",i, probe[i].temperature('c')); + pc.printf("Device[%d]: %3.1f \r\n",i, probe[i].temperature('f')); } - wait(1.0); // 1 sec + wait(1); // 1 sec } }