Skip to content

Commit

Permalink
Adjusted badge lib and clock app to support partial refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
bmeisels committed May 22, 2020
1 parent 4507294 commit 65c2698
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions apps/clock/clock.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def __init__(self):
self.assets[':'] = self.assets['colon']

def draw_time(self, dt, x, y):
timestr = '%02d:%02d' % (dt.tm_hour, dt.tm_min)
timestr = '%02d:%02d' % (dt.tm_min, dt.tm_sec)
group = displayio.Group(max_size=len(timestr), x=x, y=y)
xpos = 0
for ch in timestr:
Expand All @@ -30,14 +30,14 @@ def draw_time(self, dt, x, y):

def run(self):
display = badge.display
rtc_instance = rtc.RTC()

while True:
rtc_instance = rtc.RTC()
group = displayio.Group()
group.append(Rect(0, 0, display.width, display.height, fill=0xffffff))
group.append(self.draw_time(rtc_instance.datetime, 48, 40))
display.show(group)
while display.time_to_refresh > 0:
pass
display.refresh()
time.sleep(60-time.time()%60)
#time.sleep(1)
2 changes: 1 addition & 1 deletion lib/arambadge.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def display(self):
import adafruit_il0373
displayio.release_displays()
self._display = adafruit_il0373.IL0373(self.display_bus, width=296, height=128, rotation=270,
seconds_per_frame=5, busy_pin=board.DISP_BUSY, swap_rams=True)
seconds_per_frame=0.195, busy_pin=board.DISP_BUSY, swap_rams=True)
return self._display

@property
Expand Down

0 comments on commit 65c2698

Please sign in to comment.