Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: ds18b20/DS18B20.cpp
- Revision:
- 3:0ef2ced1f02d
- Parent:
- 1:3aec489c7366
--- a/ds18b20/DS18B20.cpp Fri Apr 11 04:55:51 2014 +0000 +++ b/ds18b20/DS18B20.cpp Sat Apr 12 20:07:15 2014 +0000 @@ -60,29 +60,6 @@ } return result; } - -ROM_Code_t ReadROM() { - ROM_Code_t ROM_Code; - if (Reset(sensor) != 0) { - inError(); - } else { - - WriteByte(sensor, READ_ROM); // Read ROM - for (uint32_t i = 0; i < 8; ++i) { - ROM_Code.rom[i] = ReadByte(sensor); - } - } - return ROM_Code; -} - -// temperature is store as 7.4 fixed point format (assuming 12 bit conversion) -void displayTemperature(Serial& s) { - DoConversion(); - uint32_t temp = GetTemperature(); - float f = (temp & 0x0F) * 0.0625; // calculate .4 part - f += (temp >> 4); // add 7.0 part to it - s.printf("Temp is %2.1fC\n\r", f); // display in 2.1 format -} float mytemp(void) { DoConversion(); uint32_t temp = GetTemperature();