HDC1080 sensor library
HDC1080.h@4:250aceaa7a01, 2019-11-10 (annotated)
- Committer:
- MACRUM
- Date:
- Sun Nov 10 14:22:08 2019 +0000
- Revision:
- 4:250aceaa7a01
- Parent:
- 1:a0e46d956969
Include mbed.h
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
shivanandgowdakr | 0:fdb750cc9ca8 | 1 | |
shivanandgowdakr | 0:fdb750cc9ca8 | 2 | #ifndef HDC1080_H |
shivanandgowdakr | 0:fdb750cc9ca8 | 3 | #define HDC1080_H |
shivanandgowdakr | 0:fdb750cc9ca8 | 4 | |
MACRUM | 4:250aceaa7a01 | 5 | #include "mbed.h" |
shivanandgowdakr | 0:fdb750cc9ca8 | 6 | |
shivanandgowdakr | 0:fdb750cc9ca8 | 7 | class HDC1080:public I2C { |
shivanandgowdakr | 0:fdb750cc9ca8 | 8 | public: |
shivanandgowdakr | 0:fdb750cc9ca8 | 9 | |
MACRUM | 1:a0e46d956969 | 10 | HDC1080( PinName sda, PinName slc) ; // constructor |
shivanandgowdakr | 0:fdb750cc9ca8 | 11 | |
shivanandgowdakr | 0:fdb750cc9ca8 | 12 | int ReadSignature(void); |
shivanandgowdakr | 0:fdb750cc9ca8 | 13 | float readTemperature( void); // to read the Temperature from HDC1080 |
shivanandgowdakr | 0:fdb750cc9ca8 | 14 | float readHumidity(void); // to read the Humidity from HDC1080 |
MACRUM | 1:a0e46d956969 | 15 | unsigned long readSerialNumber(void); // to read the Humidity from HDC1080 |
shivanandgowdakr | 0:fdb750cc9ca8 | 16 | |
shivanandgowdakr | 0:fdb750cc9ca8 | 17 | protected: |
shivanandgowdakr | 0:fdb750cc9ca8 | 18 | uint16_t read2Bytes(int chip_addr, int offset); |
MACRUM | 1:a0e46d956969 | 19 | char _buffer[5]; |
MACRUM | 1:a0e46d956969 | 20 | |
shivanandgowdakr | 0:fdb750cc9ca8 | 21 | }; |
shivanandgowdakr | 0:fdb750cc9ca8 | 22 | |
shivanandgowdakr | 0:fdb750cc9ca8 | 23 | #endif |