Created
February 29, 2016 19:22
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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