Our great sponsors
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
# Source: https://github.com/pimoroni/badger2040/blob/main/firmware/PIMORONI_BADGER2040W/lib/badger_os.py def launch(file): state_set_running(file) gc.collect() 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) def quit_to_launcher(pin): if button_a.value() and button_c.value(): machine.reset() button_a.irq(trigger=machine.Pin.IRQ_RISING, handler=quit_to_launcher) button_c.irq(trigger=machine.Pin.IRQ_RISING, handler=quit_to_launcher) try: __import__(file) except ImportError: # If the app doesn't exist, notify the user warning(None, f"Could not launch: {file}") time.sleep(4.0) except Exception as e: # If the app throws an error, catch it and display! print(e) warning(None, str(e)) time.sleep(4.0) # If the app exits or errors, do not relaunch! state_clear_running() machine.reset() # Exit back to launcher
The BadOS project is a custom OS with Circuit Python, its Github repository shows how to develop different kind of apps too
The recommended way to programm MicroPython on the Raspberry Pico is to use the Thonny IDE. Accessing the Badger with reveals the following file structure: