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.
ds18b20/DS18B20.h@3:0ef2ced1f02d, 2014-04-12 (annotated)
- Committer:
- redplam
- Date:
- Sat Apr 12 20:07:15 2014 +0000
- Revision:
- 3:0ef2ced1f02d
- Parent:
- 1:3aec489c7366
myproj
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| redplam | 1:3aec489c7366 | 1 | #ifndef _DS18B20_ |
| redplam | 1:3aec489c7366 | 2 | #define _DS18B20_ |
| redplam | 1:3aec489c7366 | 3 | |
| redplam | 1:3aec489c7366 | 4 | #include <stdint.h> |
| redplam | 1:3aec489c7366 | 5 | #include "mbed.h" |
| redplam | 1:3aec489c7366 | 6 | |
| redplam | 1:3aec489c7366 | 7 | // Device Faimly ID and Setial number information |
| redplam | 1:3aec489c7366 | 8 | typedef union { |
| redplam | 1:3aec489c7366 | 9 | uint8_t rom[8]; |
| redplam | 1:3aec489c7366 | 10 | struct { |
| redplam | 1:3aec489c7366 | 11 | uint8_t familyCode; |
| redplam | 1:3aec489c7366 | 12 | uint8_t serialNo[6]; |
| redplam | 1:3aec489c7366 | 13 | uint8_t CRC; |
| redplam | 1:3aec489c7366 | 14 | } BYTES; |
| redplam | 1:3aec489c7366 | 15 | } ROM_Code_t; |
| redplam | 1:3aec489c7366 | 16 | |
| redplam | 1:3aec489c7366 | 17 | ROM_Code_t ReadROM() ; |
| redplam | 1:3aec489c7366 | 18 | |
| redplam | 1:3aec489c7366 | 19 | // temperature is store as 7.4 fixed point format (assuming 12 bit conversion) |
| redplam | 1:3aec489c7366 | 20 | void displayTemperature(Serial& s) ; |
| redplam | 1:3aec489c7366 | 21 | float mytemp(void); |
| redplam | 1:3aec489c7366 | 22 | |
| redplam | 1:3aec489c7366 | 23 | #endif |