Badger 2040 and Badger 2040 W Documentation

repository·main·Indexed 42 days ago

https://github.com/pimoroni/badger2040

Firmware, examples, and hardware specifications for the Badger 2040 and Badger 2040 W, RP2040 and Pico W powered E Ink badge wearables. Includes guides on installing MicroPython firmware, using the Badger OS launcher, managing the 296x128 monochrome display via PicoGraphics and jpegdec, and implementing low-power sleep and wake cycles using the PCF85063A RTC on the W model.

Tokens
7.2K
Snippets
28
Records
48
Agent score
53%

What's inside Badger 2040

  1. Overview of Badger 2040 and Badger 2040 W

    main
    The Badger 2040 series consists of small, low-power, badge-style boards featuring a 2.9" monochrome e-paper display with a resolution of 296x128 pixels. These boards are optimized for use with MicroPython, and Pimoroni provides custom firmware with built-in drivers to facilitate development.
  2. Overview of Badger 2040 MicroPython Examples

    main
    The Badger 2040 MicroPython examples serve as a functional 'OS' for the Badger 2040 and Badger 2040 W. They provide a foundation for various applications including clocks, ebook readers, weather displays, and QR code generation. These examples are intended to be used as templates for custom development.
  3. Differences between Badger 2040 W and Badger 2040

    main

    The Badger 2040 W is a networking-capable version based on the Raspberry Pi Pico W. Key differences include:

    • Networking Modules: Includes network, mip, ntptime, urequests, urllib.urequest, and umqtt.simple.
    • Memory/Storage: Available filesystem size is reduced to 848K (vs 1,408K on standard) and available RAM is reduced to 166K (vs 192K on standard) due to WiFi drivers and libraries.
    • Buttons: Does not have a "user" button (the BUTTON_USER constant is None) because the BOOTSEL button is on the attached Pico W.
    • RTC: Includes a PCF85063A real-time clock that can wake the device from a power-off state.
  4. Hardware specifications for Badger 2040 W

    main

    The Badger 2040 W is a wireless version of the board. Key differences include:

    • Wireless Connectivity: Uses a Pico W instead of a standard RP2040.
    • Real-Time Clock (RTC): Includes a PCF85063A RTC, which allows the device to be woken up from a power-off state.
  5. Getting Started with Badger 2040

    main

    To begin programming your Badger 2040 or Badger 2040 W using MicroPython, you must import the badger2040 module and create an instance of the Badger2040 class. This instance, typically named badger, provides access to the display, buttons, and other hardware features.

    Note for Badger 2040 W users: You should first populate a WIFI_CONFIG.py file with your WiFi credentials to utilize networking features.

    import badger2040
    badger = badger2040.Badger2040()
  6. Migrate drawing functions to PicoGraphics compatibility

    main

    If you are porting code from an older Badger 2040 release to the current version, you must update several drawing function names to match the PicoGraphics API:

    • Rename pen() to set_pen()
    • Rename font() to set_font()
    • Rename update_speed() to set_update_speed()
    • Rename thickness() to set_thickness() (Note: this now only applies to Hershey fonts)

    Deprecated/Removed Features:

    • image() and icon() are deprecated; use JPEGs instead.
    • invert() is no longer supported.

    Hardware Note: If porting to the Badger 2040 W, be aware that the USER button is not available. You must adjust your control scheme to compensate.

  7. Install firmware on Badger 2040

    main

    To install MicroPython firmware on a standard Badger 2040:

    1. Connect the device to your computer using a USB A to C cable.
    2. Enter bootloader mode: Hold the BOOT/USR button and press the RST button next to it.
    3. A drive named RPI-RP2 will appear on your computer.
    4. Drag and drop the appropriate badger2040 .uf2 file onto the RPI-RP2 drive.
    5. The device will reset. If you installed a with-badger-os variant, the Badger OS Launcher will appear.
  8. Download Badger 2040 firmware

    main

    Firmware files can be downloaded from the latest GitHub releases.

    There are two types of .uf2 builds available:

    1. Standard builds: These include only the MicroPython firmware and preserve your existing files on the device.

      • pimoroni-badger2040-vX.X.X-micropython.uf2
      • pimoroni-badger2040w-vX.X.X-micropython.uf2
    2. with-badger-os builds: These contain a full filesystem image. Warning: Using these will overwrite both the firmware and all existing files on your Badger device.

      • pimoroni-badger2040-vX.X.X-micropython-with-badger-os.uf2
      • pimoroni-badger2040w-vX.X.X-micropython-with-badger-os.uf2
  9. Install firmware on Badger 2040 W

    main

    To install MicroPython firmware on a Badger 2040 W:

    1. Connect the device to your computer using a USB A to microB cable.
    2. Enter bootloader mode: Hold the BOOTSEL button (onboard the Pico W) and press the RESET button (located next to the qw/st connector).
    3. A drive named RPI-RP2 will appear on your computer.
    4. Drag and drop the appropriate badger2040w .uf2 file onto the RPI-RP2 drive.
    5. The device will reset. If you installed a with-badger-os variant, the Badger OS Launcher will appear.