A Python driver for the LDP8008 series of LED signs
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 8 commits ahead of nhfruchter:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
webapp
LDP-8008.pdf
README.md
__init__.py
fontv.py
ldp.py
requirements.txt
sign.py

README.md

A quick rewrite of some code floating around out there for controlling an LDP-8008 LED matrix through a Raspberry PI. It serves as a wrapper around the ldp module by Pete Goss. This provides a Sign class that you can use to control a sign.

Setup

  1. Connect the sign to your Raspberry Pi. A recommended pin setup is given in ldp.py; if you use something different, change the pin numbers in that file to match.
  2. Import the module.
  3. You're ready to go!

Examples

Making the sign display something is a two step process. First, you have to write to the sign's buffer. Second, you have to tell it to display the current text.

  >>> s = sign.Sign()
  >>> # You can scroll an arbitrarily long string.
  >>> s.scrollPut("1234567890abcdefgh  ")
  >>> s.scroll()
  >>> # Or a fixed-width string.
  >>> s.stop()
  >>> s.staticPut("Testing")
  >>> s.static()

The sign also has three colors that you can use, but defaults to red.

  >>> s.staticPut("Hello", s.ORANGE)
  >>> s.stop()

Finally, you can display your own custom bitmaps on the sign, which should take the form of an 80x8 2D array.

  >>> s.buffer = [[1 for i in xrange(s.WIDTH)] for i in xrange(s.HEIGHT)] # Light it up!
  >>> s.static()
  >>> s.stop()

Implementation note

Having a separate stop() function for the sign is necessary as the sign only seems to be driven when actively being written to. (There's no freeze function, so to speak.) Because of this, the buffer display function is run in a separate thread using a while True infinite loop. The stop() command just kills that thread and resets the sign's buffer. There's probably a better way, so feel free to mess around with the system.