From e19fe9cb7300b7b4e5e441aa6c6d028a25dd648d Mon Sep 17 00:00:00 2001 From: Mike Bell Date: Fri, 25 Mar 2022 00:29:09 +0000 Subject: [PATCH] Apparently Thonny doesn't clear blank lines on save --- micropython/examples/badger2040/badge.py | 6 +++--- micropython/examples/badger2040/image.py | 2 +- micropython/examples/badger2040/launcher.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/micropython/examples/badger2040/badge.py b/micropython/examples/badger2040/badge.py index a599e51df..dff8a120a 100644 --- a/micropython/examples/badger2040/badge.py +++ b/micropython/examples/badger2040/badge.py @@ -217,7 +217,7 @@ 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) @@ -225,9 +225,9 @@ def draw_badge(): 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) diff --git a/micropython/examples/badger2040/image.py b/micropython/examples/badger2040/image.py index 05f1a0b75..22d61e07c 100644 --- a/micropython/examples/badger2040/image.py +++ b/micropython/examples/badger2040/image.py @@ -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 diff --git a/micropython/examples/badger2040/launcher.py b/micropython/examples/badger2040/launcher.py index 66fc49770..d07794fbd 100644 --- a/micropython/examples/badger2040/launcher.py +++ b/micropython/examples/badger2040/launcher.py @@ -226,5 +226,5 @@ def button(pin): if changed: badger_os.state_save("launcher", page, font_size, inverted) changed = False - + display.halt()