The_Official_Raspberry_Pi_-_Beginner’s_Book_Vol1,_2018 (1)

(singke) #1
Chapter 7 Physical Computing with the Sense HAT 175

THE OFFICIAL RASPBERRY PI BEGINNER’S GUIDE


5 Figure 7-18: Showing the pressure sensor reading


To switch to the humidity sensor, delete the pressure block and replace it with humidity .
Run your program again, and you’ll see the current relative humidity of your room. Again, you
can try running it again while blowing on the Sense HAT (or moving the emulator’s Humidity
slider up) to change the reading (Figure 7-19) – your breath is surprisingly humid!


5 Figure 7-19: Displaying the reading from the humidity sensor


CHANGING VALUES
If you’re using the Sense HAT emulator, you can change the values
reported by each of the emulated sensors using its sliders and
buttons. Try sliding the pressure sensor setting down towards the
bottom, then clicking the green flag again.
Free download pdf