Bulme library for LM75B temp. sensor
LM75B.h@0:c622220fe79d, 2016-03-14 (annotated)
- Committer:
- fritzhausmann
- Date:
- Mon Mar 14 13:30:16 2016 +0000
- Revision:
- 0:c622220fe79d
Bulme library for LM75B temp. sensor
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
fritzhausmann | 0:c622220fe79d | 1 | #include "mbed.h" |
fritzhausmann | 0:c622220fe79d | 2 | #ifndef LM75B_H |
fritzhausmann | 0:c622220fe79d | 3 | #define LM75B_H |
fritzhausmann | 0:c622220fe79d | 4 | |
fritzhausmann | 0:c622220fe79d | 5 | // LM75B Adresse |
fritzhausmann | 0:c622220fe79d | 6 | #define LM75B_ADDR 0x90 |
fritzhausmann | 0:c622220fe79d | 7 | |
fritzhausmann | 0:c622220fe79d | 8 | // LM75B Register |
fritzhausmann | 0:c622220fe79d | 9 | #define LM75B_CONF 0x01 |
fritzhausmann | 0:c622220fe79d | 10 | #define LM75B_TEMP 0x00 |
fritzhausmann | 0:c622220fe79d | 11 | |
fritzhausmann | 0:c622220fe79d | 12 | class LM75B |
fritzhausmann | 0:c622220fe79d | 13 | { |
fritzhausmann | 0:c622220fe79d | 14 | public: |
fritzhausmann | 0:c622220fe79d | 15 | LM75B(PinName sda, PinName scl); // I2C Pins übergeben p28, p27 |
fritzhausmann | 0:c622220fe79d | 16 | ~LM75B(); |
fritzhausmann | 0:c622220fe79d | 17 | float read(); |
fritzhausmann | 0:c622220fe79d | 18 | |
fritzhausmann | 0:c622220fe79d | 19 | private: |
fritzhausmann | 0:c622220fe79d | 20 | char cmd[2]; |
fritzhausmann | 0:c622220fe79d | 21 | I2C i2c; |
fritzhausmann | 0:c622220fe79d | 22 | }; |
fritzhausmann | 0:c622220fe79d | 23 | #endif |