From 6e44434e7de9ee236ef8c02b0626c0ed7c085933 Mon Sep 17 00:00:00 2001 From: thirdr Date: Tue, 24 Jan 2023 15:03:55 +0000 Subject: [PATCH] fixed quit to launcher --- .../examples/badger2040w/examples/net_info.py | 20 ------------------- .../examples/badger2040w/examples/news.py | 15 -------------- 2 files changed, 35 deletions(-) diff --git a/micropython/examples/badger2040w/examples/net_info.py b/micropython/examples/badger2040w/examples/net_info.py index 705dc179..083db599 100644 --- a/micropython/examples/badger2040w/examples/net_info.py +++ b/micropython/examples/badger2040w/examples/net_info.py @@ -1,8 +1,6 @@ import badger2040w as badger2040 from badger2040w import WIDTH -import time import network -import machine TEXT_SIZE = 1 LINE_HEIGHT = 16 @@ -11,24 +9,6 @@ LINE_HEIGHT = 16 display = badger2040.Badger2040W() display.led(128) - -# Button handler -def button(pin): - - time.sleep(0.01) - if not pin.value(): - return - - if button_a.value() and button_c.value(): - machine.reset() - - -# Setup buttons -button_a = machine.Pin(badger2040.BUTTON_A, machine.Pin.IN, machine.Pin.PULL_DOWN) -button_c = machine.Pin(badger2040.BUTTON_C, machine.Pin.IN, machine.Pin.PULL_DOWN) -button_a.irq(trigger=machine.Pin.IRQ_RISING, handler=button) -button_c.irq(trigger=machine.Pin.IRQ_RISING, handler=button) - # Connects to the wireless network. Ensure you have entered your details in WIFI_CONFIG.py :). display.connect() net = network.WLAN(network.STA_IF).ifconfig() diff --git a/micropython/examples/badger2040w/examples/news.py b/micropython/examples/badger2040w/examples/news.py index c8c4239a..e4ba7045 100644 --- a/micropython/examples/badger2040w/examples/news.py +++ b/micropython/examples/badger2040w/examples/news.py @@ -1,6 +1,5 @@ import badger2040w as badger2040 from badger2040w import WIDTH -import time import machine from urllib import urequest import gc @@ -26,17 +25,6 @@ display = badger2040.Badger2040W() display.led(128) display.set_update_speed(2) - -# Button handler -def button(pin): - time.sleep(0.01) - if not pin.value(): - return - - if button_a.value() and button_c.value(): - machine.reset() - - # Setup buttons button_a = machine.Pin(badger2040.BUTTON_A, machine.Pin.IN, machine.Pin.PULL_DOWN) button_b = machine.Pin(badger2040.BUTTON_B, machine.Pin.IN, machine.Pin.PULL_DOWN) @@ -44,9 +32,6 @@ button_c = machine.Pin(badger2040.BUTTON_C, machine.Pin.IN, machine.Pin.PULL_DOW button_down = machine.Pin(badger2040.BUTTON_DOWN, machine.Pin.IN, machine.Pin.PULL_DOWN) button_up = machine.Pin(badger2040.BUTTON_UP, machine.Pin.IN, machine.Pin.PULL_DOWN) -button_a.irq(trigger=machine.Pin.IRQ_RISING, handler=button) -button_c.irq(trigger=machine.Pin.IRQ_RISING, handler=button) - def read_until(stream, char): result = b""