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.
Dependents: AmbientExampleLPC1768 HumidifierController_LPC824 TYBLE16_mbedlized_Thermometer
HDC1000 Class Reference
Interface for Humidity / Temperature Sensor, HDC1000. More...
#include <HDC1000.h>
Public Member Functions | |
HDC1000 (PinName p_sda, PinName p_scl) | |
Configure data pin (with other devices on I2C line) | |
HDC1000 (PinName p_sda, PinName p_scl, uint8_t addr) | |
Configure data pin (with other devices on I2C line) | |
HDC1000 (I2C &p_i2c) | |
Configure data pin (with other devices on I2C line) | |
void | get (void) |
Start convertion & data save. | |
float | temperature (void) |
Read temperature data. | |
float | humidity (void) |
Read humidity data. | |
void | config (void) |
HDC1000 Configuration. | |
uint16_t | read_config (void) |
Read Configuration. | |
uint16_t | set_config (uint16_t cfg) |
Set config register. | |
void | frequency (int hz) |
Set I2C clock frequency. | |
uint8_t | who_am_i (void) |
check Device ID number | |
uint16_t | read_M_ID (void) |
Read Manufacturer ID. | |
uint16_t | read_D_ID (void) |
Read Device ID. |
Detailed Description
Interface for Humidity / Temperature Sensor, HDC1000.
#include "mbed.h" #include "HDC1000.h" // I2C Communication HDC1000 hmtp(dp5,dp27); // HDC1000 SDA, SCL (Akizuki module) // If you connected I2C line not only this device but also other devices, // you need to declare following method. I2C i2c(dp5,dp27); // SDA, SCL HDC1000 hmtp(i2c); // HDC1000 SDA, SCL (Akizuki module) int main() {; while(true){ hmtp.get(); // Triger conversion printf("Temp: %+4.1fC, Humid: %4.1f%%\r\n", hmtp.temperature(), hmtp.humidity()); wait(1.0); } }
Definition at line 77 of file HDC1000.h.
Constructor & Destructor Documentation
HDC1000 | ( | PinName | p_sda, |
PinName | p_scl | ||
) |
Configure data pin (with other devices on I2C line)
- Parameters:
-
data SDA and SCL pins
Definition at line 15 of file HDC1000.cpp.
HDC1000 | ( | PinName | p_sda, |
PinName | p_scl, | ||
uint8_t | addr | ||
) |
Configure data pin (with other devices on I2C line)
- Parameters:
-
data SDA and SCL pins device address
Definition at line 22 of file HDC1000.cpp.
HDC1000 | ( | I2C & | p_i2c ) |
Configure data pin (with other devices on I2C line)
- Parameters:
-
I2C previous definition
Definition at line 29 of file HDC1000.cpp.
Member Function Documentation
void config | ( | void | ) |
void frequency | ( | int | hz ) |
void get | ( | void | ) |
Start convertion & data save.
- Parameters:
-
none
- Returns:
- none
Definition at line 42 of file HDC1000.cpp.
float humidity | ( | void | ) |
uint16_t read_config | ( | void | ) |
Read Configuration.
- Parameters:
-
none
- Returns:
- config. data
Definition at line 103 of file HDC1000.cpp.
uint16_t read_D_ID | ( | void | ) |
uint16_t read_M_ID | ( | void | ) |
uint16_t set_config | ( | uint16_t | cfg ) |
Set config register.
- Parameters:
-
config parameter
- Returns:
- config read data
Definition at line 94 of file HDC1000.cpp.
float temperature | ( | void | ) |
Read temperature data.
- Parameters:
-
none
- Returns:
- temperature
Definition at line 54 of file HDC1000.cpp.
uint8_t who_am_i | ( | void | ) |
check Device ID number
- Parameters:
-
none
- Returns:
- HDC1000 = 1, others 0
Definition at line 84 of file HDC1000.cpp.
Generated on Mon Jul 18 2022 02:20:44 by
