Skip to content

This has a Python class that controls a 7 Segment Display connected to a Raspberry Pi.

Notifications You must be signed in to change notification settings

m01/sevensegment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

This repository contains a simple Python module, which can control a seven segment display attached to a Raspberry Pi.

I used the following 7 segment display (datasheet here), and wired it up in the following way:

Raspberry Pi Pin 7 segment display pins
1 3,5,11,16, via a resistor (3.3V)
11 (GPIO 0) 1 (segment a)
12 14 (b)
13 12 (c)
15 10 (d)
16 4 (e)
18 2 (f)
22 13 (g)

Example usage:

% sudo python # so that you can access the GPIO pins
>>> from sevensegment import *
>>> import time
>>> s=sevensegment.SevenSegmentDisplay()
>>> s.set(1)
>>> for i in range(0, 10):
...     print("Displaying %d" % i)
...     s.set(i)
...     time.sleep(1)
... 
Displaying 0
Displaying 1
Displaying 2
Displaying 3
Displaying 4
Displaying 5
Displaying 6
Displaying 7
Displaying 8
Displaying 9
>>> s.off()

About

This has a Python class that controls a 7 Segment Display connected to a Raspberry Pi.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages