Closed alexwoolford closed 7 years ago
Hi, It looks like the Java example is missing a call to:
sensor.sampleData();
in the loop. This is needed to actually read updated data from the device...
Thanks so much, @jontrulson . That worked perfectly! I really appreciate your help.
Yes, sorry about that. Fixed and restructured the Java example after the Python one https://github.com/intel-iot-devkit/upm/pull/562/commits/29e1489e40b8b8c5bcd0756725ae06eb9bf772d5
Merged to master. Thanks!
The HTU21DSample.java always returns a temperature of 0.0.
The following dependency was added to
pom.xml
:I used the same values for the bus (1) and the I2C address (0x40; decimal value of 64) that worked in Python. Here's a snippet of Java where I'm trying to read the temperature:
The Java code returns a temperature of 0.0, where the Python code (linked above) shows the actual temperature. I experimented with different values for the bus and I2C address. Nothing worked.
Am I doing something wrong? Any suggestions for a (Java) workaround?