mirror of
https://github.com/eclipse/upm.git
synced 2025-07-01 17:31:13 +03:00
th02: fix non-working driver
There were a few issues with this driver, corrected in this update. 1) i2c transactions were not working - I replaced the i2c implementation with the MRAA i2c class implementation. 2) status check was inverted - fixed. 3) fixed up #defines in header file to avoid naming collisions (ADDR, etc). 4) Added capability to supply bus and i2c address to ctor, setting defaults of 0, and TH02_ADDR respectively. NOTE: For proper operation on Edison using the arduino breakout board, the voltage needs to be set to 3.3V rather than 5v. On G2, 5v works fine. Signed-off-by: Jon Trulson <jtrulson@ics.com> Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:

committed by
Mihai Tudor Panu

parent
d36499eac8
commit
b633ecf97f
@ -50,7 +50,7 @@ main(int argc, char **argv)
|
||||
|
||||
while (!doWork) {
|
||||
temperature = sensor->getTemperature ();
|
||||
// humidity = sensor->getHumidity ();
|
||||
humidity = sensor->getHumidity ();
|
||||
std::cout << "Temperature = " << temperature << ", Humidity = " << humidity << std::endl;
|
||||
usleep (500000);
|
||||
}
|
||||
|
Reference in New Issue
Block a user