O'Reilly logo

Raspberry Pi: Amazing Projects from Scratch by Richard Grimmett, Matthew Poole, Arush Kakkar, Ashwin Pajankar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Displaying the weather

For our first project, we will be using the humidity and temperature sensor of the gross array and use its measurements to be displayed on an OLED display. You will need the two modules and some connection cables to set up the hardware for this project.

Displaying the weather

Connect the only display module to any of the three i2c ports on the GrovePi, and connect the humidity and temperature sensor to port D7. Now we will have a look at the following code and then learn what each statement does:

from grovepi import * from grove_oled import * dht_sensor_port = 7 oled_init() oled_clearDisplay() oled_setNormalDisplay() oled_setVerticalMode() time.sleep(.1) ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required