Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- # by Owen Allpress
- import dothat.backlight as backlight
- import dothat.lcd as lcd
- import time
- def countdown(count):
- while (count >= 1):
- lcd.clear()
- lcd.set_cursor_position(2, 0)
- lcd.set_contrast(45)
- lcd.write("Torch off in:")
- backlight.set_graph(1)
- lcd.set_cursor_position(8, 2)
- backlight.rgb(150, 150, 150)
- lcd.write(str(count))
- count -= 1
- time.sleep(1)
- countdown(10)
- lcd.clear()
- lcd.set_cursor_position(4, 1)
- backlight.set_graph(0)
- lcd.write ("Good bye!")
- time.sleep(2)
- lcd.clear()
- backlight.off()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement