Download Raspberry Pi Cookbook

Transcript
segment.writeDigit(0, int(hour / 10))
The first argument (0) is the digit position. Note that these positions are 0, 1, 3, and 4.
Position 2 is reserved for the two dots in the center of the display.
The second argument is the number to display.
See Also
You can find out more about the Adafruit library at http://bit.ly/HQBE6W.
13.2. Displaying Messages on an I2C LED matrix
Problem
You want to control the pixels of a multicolor LED matrix display.
Solution
Use an I2C LED module, such as the model shown in Figure 13-3 attached via a bread‐
board to a Raspberry Pi. Note that the LED in the breadboard layout looks a little dif‐
ferent to the one in the wiring diagram, but their pinouts are the same.
Figure 13-3. LED matrix display with Raspberry Pi
To make this recipe, you need:
• Breadboard and jumper wires (see “Prototyping Equipment” on page 380)
332
|
Chapter 13: Displays