first live version: v 0.0.5

This commit is contained in:
Jan
2019-09-24 16:44:24 +02:00
parent 4373290b66
commit b9c4cdf93a
2 changed files with 244 additions and 99 deletions

View File

@@ -12,6 +12,7 @@ HexDigits = [0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d,
# 0 1 2 3 4 5 6
# 7 8 9 A B C D E F = r
# 10 11 12 13 14 15 16 17
#
# 0
# ---
@@ -46,8 +47,6 @@ class TM1637:
def cleanup(self):
"""Stop updating clock, turn off display, and cleanup GPIO"""
self.StopClock()
self.Clear()
IO.cleanup()
def Clear(self):
@@ -212,7 +211,7 @@ class TM1637:
if __name__ == "__main__":
"""Confirm the display operation"""
display = TM1637(CLK=26, DIO=16, brightness=1.0)
display = TM1637(CLK=14, DIO=4, brightness=1.0)
display.Clear()
@@ -254,3 +253,27 @@ if __name__ == "__main__":
display.Show1(3,17);
# See clock.py for how to use the clock functions!
display.SetBrightnessRaw(0)
print "level=0"
scrap=raw_input()
display.SetBrightnessRaw(1)
print "level=1"
scrap=raw_input()
display.SetBrightnessRaw(2)
print "level=2"
scrap=raw_input()
display.SetBrightnessRaw(3)
print "level=3"
scrap=raw_input()
display.SetBrightnessRaw(4)
print "level=4"
scrap=raw_input()
display.SetBrightnessRaw(5)
print "level=5"
scrap=raw_input()
display.SetBrightnessRaw(6)
print "level=6"
scrap=raw_input()
display.SetBrightnessRaw(7)
print "level=7"
scrap=raw_input()