Skip to content

Instantly share code, notes, and snippets.

@fire-eggs
Created February 29, 2016 19:22
Show Gist options
  • Save fire-eggs/3e2beeb6aee42b324b4d to your computer and use it in GitHub Desktop.
Save fire-eggs/3e2beeb6aee42b324b4d to your computer and use it in GitHub Desktop.
A Python script to demonstrate a 'hidden' feature of the Pimoroni Display-o-tron Hat : lcd shifting
#!/usr/bin/env python
print("""
This example shows you a feature of the LCD hardware used
by the Dot HAT. You should see some text dance!
Press CTRL+C to exit.
""")
import dothat.backlight as backlight
import dothat.lcd as lcd
import atexit
import time
def tidyup():
backlight.off()
lcd.clear()
# This line gives us access to features of the underlying
# LCD which are not exposed in the dothat.lcd code.
baselcd = lcd.lcd
backlight.graph_off()
backlight.rgb(92,172,238)
lcd.set_cursor_position(2,1)
lcd.write(" *dance time* ")
atexit.register(tidyup)
while True:
baselcd.shift_left()
time.sleep(0.15)
baselcd.shift_right()
time.sleep(0.15)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment