Humidity Sensor
Last updated
Was this helpful?
Last updated
Was this helpful?
You know how to get a handle on the humidity sensor connected to your computer
You can get the sensor's values, get frequently notified about new values, and distinguish between humidity and temperature values
Working with a sensor works as described in the general article on . In this article, we assume you have successfully initialized the devices with the , and you stored all connected devices on a global variable devices
. We also declared a global variable called humiditySensor
.
Next, we need to know the device identifier, which 283:
Once we have a reference to the sensor, we can register a callback function:
Of course, we have to actually define the function:
Since the sensor delivers two different value types, temperature and humidity, why not use the callback function to illustrate how we can distinguish both types:
That is basically it - we can't do anything else with a sensor.