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.
test_LM75B.h@5:863659ef0231, 2014-11-03 (annotated)
- Committer:
- okano
- Date:
- Mon Nov 03 00:26:01 2014 +0000
- Revision:
- 5:863659ef0231
- Parent:
- 4:c372135e7d0c
- Child:
- 6:ab79d1157026
two constructors version
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| okano | 0:6ecb302da815 | 1 | #include "mbed.h" |
| okano | 0:6ecb302da815 | 2 | |
| okano | 0:6ecb302da815 | 3 | // LM75B I2C slave address |
| okano | 0:6ecb302da815 | 4 | #define ADDRESS_LM75B 0x90 |
| okano | 0:6ecb302da815 | 5 | |
| okano | 0:6ecb302da815 | 6 | // LM75B registers |
| okano | 0:6ecb302da815 | 7 | #define LM75B_Conf 0x01 |
| okano | 0:6ecb302da815 | 8 | #define LM75B_Temp 0x00 |
| okano | 0:6ecb302da815 | 9 | #define LM75B_Tos 0x03 |
| okano | 0:6ecb302da815 | 10 | #define LM75B_Thyst 0x02 |
| okano | 0:6ecb302da815 | 11 | |
| okano | 0:6ecb302da815 | 12 | class test_LM75B |
| okano | 0:6ecb302da815 | 13 | { |
| okano | 0:6ecb302da815 | 14 | public: |
| okano | 1:239684cd8ae9 | 15 | test_LM75B( PinName sda, PinName scl, char address = ADDRESS_LM75B ); |
| okano | 5:863659ef0231 | 16 | test_LM75B( I2C &i2c_obj, char address = ADDRESS_LM75B ); |
| okano | 0:6ecb302da815 | 17 | ~test_LM75B(); |
| okano | 1:239684cd8ae9 | 18 | void init( void ); |
| okano | 1:239684cd8ae9 | 19 | float read( void ); |
| okano | 1:239684cd8ae9 | 20 | operator float( void ); |
| okano | 0:6ecb302da815 | 21 | private: |
| okano | 5:863659ef0231 | 22 | I2C *i2c_p; |
| okano | 5:863659ef0231 | 23 | I2C &i2c; |
| okano | 1:239684cd8ae9 | 24 | char adr; |
| okano | 0:6ecb302da815 | 25 | }; |