As seen in this photo, +3.3VDC and Gnd are supplied by the Gertboard. The SDA and SCL signals are connected on the Gertboard J2 header for convenience. Otherwise, the Gertboard is not used in this test.
The display operates on a supply voltage of either 3.3VDC or 5VDC, which means it can be connected to the RPi without level conversion as long as it is powered by 3.3VDC. Its brightness can be adjusted to 16 levels by command, as well as a blink rate. The display continues to illuminate its last set of characters without an I2C connection, as long as it has power.
This short program generates random numbers and displays them. It is using Adafruit's SevenSegment module, which is part of their 'Adafruit-Raspberry-Pi-Python-Code' package, to turn on the proper segments.
- Code: Select all
from Adafruit_7Segment import SevenSegment
segment = SevenSegment(address=0x70)
If you're curious, the 'theoretical' odds of all 4 numbers coming up the same is 1/10000.