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
import time import random from Adafruit_7Segment import SevenSegment segment = SevenSegment(address=0x70) while True: segment.writeDigit(0,random.randint(0,9)) segment.writeDigit(1,random.randint(0,9)) segment.writeDigit(3,random.randint(0,9)) segment.writeDigit(4,random.randint(0,9)) time.sleep(3)