IUT CACHAN
/
DS18B20
Test DS18B20 sur D8
Revision 1:7bf2fdef45c9, committed 2021-06-21
- Comitter:
- iut_cachan01
- Date:
- Mon Jun 21 09:55:09 2021 +0000
- Parent:
- 0:03ec282c2908
- Commit message:
- Test DS18B20 sur D8
Changed in this revision
diff -r 03ec282c2908 -r 7bf2fdef45c9 DS18B20.cpp --- a/DS18B20.cpp Fri Jan 29 19:01:56 2010 +0000 +++ b/DS18B20.cpp Mon Jun 21 09:55:09 2021 +0000 @@ -16,7 +16,7 @@ uint8_t reserved0xFF; uint8_t reserved0xCH; uint8_t reserved0x10; - uint8_t CRC; + uint8_t crc; } ScratchPad_t;
diff -r 03ec282c2908 -r 7bf2fdef45c9 DS18B20.h --- a/DS18B20.h Fri Jan 29 19:01:56 2010 +0000 +++ b/DS18B20.h Mon Jun 21 09:55:09 2021 +0000 @@ -10,7 +10,7 @@ struct { uint8_t familyCode; uint8_t serialNo[6]; - uint8_t CRC; + uint8_t crc; } BYTES; } ROM_Code_t;
diff -r 03ec282c2908 -r 7bf2fdef45c9 main.cpp --- a/main.cpp Fri Jan 29 19:01:56 2010 +0000 +++ b/main.cpp Mon Jun 21 09:55:09 2021 +0000 @@ -2,7 +2,7 @@ #include <stdint.h> #include "DS18B20.h" -DigitalInOut sensor(p5); // sensor connected to pin 5 +DigitalInOut sensor(D8); // sensor connected to pin 5 Ticker timer; // used for our microsec timing Serial pc(USBTX, USBRX); // serial comms over usb back to console @@ -18,12 +18,12 @@ for (uint32_t i = 6; i != 0; --i) { pc.printf("%02X%s", ROM_Code.BYTES.serialNo[i-1], (i != 1)?":":"\r\n"); } - pc.printf("CRC: 0x%X\r\n", ROM_Code.BYTES.CRC); + pc.printf("CRC: 0x%X\r\n", ROM_Code.BYTES.crc); pc.printf("\n\rRunning temperature conversion...\n\r"); while (1) { displayTemperature(pc); - wait(10); + wait(1); } }
diff -r 03ec282c2908 -r 7bf2fdef45c9 mbed.bld --- a/mbed.bld Fri Jan 29 19:01:56 2010 +0000 +++ b/mbed.bld Mon Jun 21 09:55:09 2021 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/mbed/builds/49a220cc26e0 +https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400 \ No newline at end of file