Create a Codecraft sketch that shows the temperature and humidity on the OLED display.
Use the "Temperature&Humidity Sensor" block to get the temperature and humidity sensor values.
Important: There are two versions of the Grove Beginner Kit with different temperature and humidity sensor modules:
Blue temperature and humidity sensor "D3" module
In the "Grove Digital" menu, select the "Temperature&Humidity Sensor pin D3" block.
Be sure to select the correct pin.
Black temperature and humidity sensor "IIC" module
In the "Grove IIC" menu, select the "Temperature&Humidity Sensor (DHT20)" block.
Use the "toString" block to convert the sensor numeric value into a text string for the '0.96" OLED screen show text" block. Otherwise, you'll get an "Upload Failed" message.
Show "Temperature", "C", "Humidity", "%" to make your display readable. Use OLED screen show row and column parameters to place the text in a specific position on the display. Arrange this anyway you'd like, perhaps something like:
Temperature:
21 C
Humidity:
26 %
Upload and test your sketch.
Breath gently on the sensor to change the temperature and humidity. Have the displayed values increased?
Caution: The sensor will be damaged if it gets wet, so don't spray water or other liquids on it.
Please try to create this sketch yourself, but if you're stuck, here's a working example for you to download and open in Codecraft:
Be sure to save your sketch so you can use it in the next lesson.
Challenges:
When the humidity increases above a specific level, sound an alarm with the buzzer and display a warning message on the OLED display.
your ideas?