A Library for the AMS ENS210 temperature and humidity sensor.
Dependents: AMS_CCS811_gas_sensor AMS_CCS811_gas_sensor
Diff: AMS_ENS210.h
- Revision:
- 8:1a7d241afbcb
- Parent:
- 6:475b764b720d
--- a/AMS_ENS210.h Tue Jan 24 14:08:26 2017 +0000 +++ b/AMS_ENS210.h Wed Mar 08 09:44:13 2017 +0000 @@ -41,26 +41,29 @@ public: /** Create an AMS_ENS210 instance * - * @param i2c The I2C interface to use for communication + * @param sda I2C SDA pin + * @param scl I2C SCL pin */ - AMS_ENS210(I2C * i2c); + AMS_ENS210(PinName sda, PinName scl); /** Create an AMS_ENS210 instance * - * @param i2c The I2C interface to use for communication + * @param sda I2C SDA pin + * @param scl I2C SCL pin * @param temp_continuous Set tempurature operation mode, true for continuous and false for single shot * @param humid_continuous Set humidity operation mode, true for continuous and false for single shot */ - AMS_ENS210(I2C * i2c, bool temp_continuous, bool humid_continuous); + AMS_ENS210(PinName sda, PinName scl, bool temp_continuous, bool humid_continuous); /** Create an AMS_ENS210 instance * - * @param i2c The I2C interface to use for communication + * @param sda I2C SDA pin + * @param scl I2C SCL pin * @param temp_continuous Set tempurature operation mode, true for continuous and false for single shot * @param humid_continuous Set humidity operation mode, true for continuous and false for single shot * @param low_power Set power mode, true for low power/standby and false for active */ - AMS_ENS210(I2C * i2c, bool temp_continuous, bool humid_continuous, bool low_power); + AMS_ENS210(PinName sda, PinName scl, bool temp_continuous, bool humid_continuous, bool low_power); /** Destroy the AMS_ENS210 instance */ @@ -193,7 +196,7 @@ uint16_t humid_read(); private: - I2C * _i2c; + I2C _i2c; bool _temp_mode; bool _humid_mode; bool _power_mode;