Skip to content

Commit

Permalink
Apparently Thonny doesn't clear blank lines on save
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelBell committed Mar 25, 2022
1 parent 994ddba commit e19fe9c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions micropython/examples/badger2040/badge.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,17 +217,17 @@ def draw_badge():
# Pressing A and C together quits the app
if display.pressed(badger2040.BUTTON_A) and display.pressed(badger2040.BUTTON_C):
break

if display.pressed(badger2040.BUTTON_A) or display.pressed(badger2040.BUTTON_B) or display.pressed(badger2040.BUTTON_C) or display.pressed(badger2040.BUTTON_UP) or display.pressed(badger2040.BUTTON_DOWN):
draw_overlay("To change the text, connect Badger2040 to a PC, load up Thonny, and modify badge.txt",
WIDTH - OVERLAY_BORDER, HEIGHT - OVERLAY_BORDER, OVERLAY_SPACING, OVERLAY_TEXT_SIZE)
display.update()
time.sleep(4)

draw_badge()

display.update()

# If on battery, halt the Badger to save power, it will wake up if any of the front buttons are pressed
display.halt()
time.sleep(0.1)
2 changes: 1 addition & 1 deletion micropython/examples/badger2040/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def show_image(n):
# Pressing A and C together quits the app
if display.pressed(badger2040.BUTTON_A) and display.pressed(badger2040.BUTTON_C):
break

if display.pressed(badger2040.BUTTON_UP):
if current_image > 0:
current_image -= 1
Expand Down
2 changes: 1 addition & 1 deletion micropython/examples/badger2040/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,5 +226,5 @@ def button(pin):
if changed:
badger_os.state_save("launcher", page, font_size, inverted)
changed = False

display.halt()

0 comments on commit e19fe9c

Please sign in to comment.