Clean up code

This commit is contained in:
Mike Cifelli 2022-12-23 18:31:04 -05:00
parent fcd9d6465f
commit e1e6878923
2 changed files with 15 additions and 22 deletions

View File

@ -18,28 +18,21 @@ class CharacterDisplay:
self.minX = minX self.minX = minX
self.maxX = maxX self.maxX = maxX
def displayDigit(self, x, y, digit, color): self.digits = {
if digit == 0: 0: self.displayZero,
self.displayZero(x, y, color) 1: self.displayOne,
elif digit == 1: 2: self.displayTwo,
self.displayOne(x, y, color) 3: self.displayThree,
elif digit == 2: 4: self.displayFour,
self.displayTwo(x, y, color) 5: self.displayFive,
elif digit == 3: 6: self.displaySix,
self.displayThree(x, y, color) 7: self.displaySeven,
elif digit == 4: 8: self.displayEight,
self.displayFour(x, y, color) 9: self.displayNine
elif digit == 5: }
self.displayFive(x, y, color)
elif digit == 6:
self.displaySix(x, y, color)
elif digit == 7:
self.displaySeven(x, y, color)
elif digit == 8:
self.displayEight(x, y, color)
elif digit == 9:
self.displayNine(x, y, color)
def displayDigit(self, x, y, digit, color):
self.digits[digit](x, y, color)
self.unicorn.show() self.unicorn.show()
def clearDigit(self, x, y): def clearDigit(self, x, y):

View File

@ -9,7 +9,7 @@ class TimeDisplay:
self.currentHour = [-1, -1] self.currentHour = [-1, -1]
self.currentMinute = [-1, -1] self.currentMinute = [-1, -1]
self.currentColor = [0, 0, 0] self.currentColor = [0, 0, 0]
self.color = [255, 120, 0] self.color = [255, 80, 0]
self.hourStartColumn = -1 self.hourStartColumn = -1
self.timeDotsColumn = 7 self.timeDotsColumn = 7
self.minuteStartColumn = 9 self.minuteStartColumn = 9