mirror of
https://github.com/eclipse/upm.git
synced 2025-03-14 20:47:30 +03:00
java: Fixed HTU21DSample
Signed-off-by: Stefan Andritoiu <stefan.andritoiu@gmail.com> Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:
parent
c64d04d084
commit
2b70bea44f
@ -22,29 +22,24 @@
|
||||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
//NOT TESTED!!!
|
||||
public class HTU21DSample {
|
||||
|
||||
public static void main(String[] args) throws InterruptedException {
|
||||
// ! [Interesting]
|
||||
float humidity = 0;
|
||||
float temperature = 0;
|
||||
float compRH = 0;
|
||||
|
||||
upm_htu21d.HTU21D sensor = new upm_htu21d.HTU21D(0);
|
||||
sensor.testSensor();
|
||||
|
||||
while (true) {
|
||||
compRH = sensor.getCompRH();
|
||||
humidity = sensor.getHumidity();
|
||||
temperature = sensor.getTemperature();
|
||||
sensor.sampleData();
|
||||
|
||||
System.out.println("Humidity: " + humidity + ", Temperature: " + temperature
|
||||
+ ", compensated RH: " + compRH);
|
||||
System.out.println("Humidity: " + sensor.getHumidity() + "%");
|
||||
System.out.println("Compensated RH: " + sensor.getCompRH() + "%");
|
||||
System.out.println("Temperature: " + sensor.getTemperature() + "C");
|
||||
System.out.println("Dew Point: " + sensor.getDewPoint() + "C");
|
||||
|
||||
Thread.sleep(5000);
|
||||
Thread.sleep(1000);
|
||||
}
|
||||
// ! [Interesting]
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user