AM2315 I2C Temperature and Humidity Sensor. Tested on Nucleo STM32 F103RB with 3.3V supply and no pullup resistors and I2C level converter with 5V supply and pullup resistors as well.
AM2315.h
- Committer:
- pici
- Date:
- 2014-09-25
- Revision:
- 0:770879aaecd5
File content as of revision 0:770879aaecd5:
#ifndef MBED_AM2315_H #define MBED_AM2315_H #include "mbed.h" #define AM2315_ADDR 0xB8 #define AM2315_REG_READ 0x03 class AM2315 { public: AM2315(PinName SDA , PinName SCL ); bool read(); float celsius; float humidity; private: I2C i2c; }; #endif