An application which displays text on various devices.
The MicroPython code is located in the mpy
directory.
- Copy the MicroPython code to your device.
- Edit the
DEVICE_TYPE
inconfig.json
to match your device. - Optionally set
WIFI_NETWORK
andWIFI_PASSWORD
inconfig.json
.
It is really important to set the correct device type. If you forget and your device starts to behave weirdly, you may need to flash the Pico Universal Flash Nuke and then re-flash the relevant firmware.
The following configuration items can be set in config.json
, and are optional unless otherwise noted:
DEVICE_TYPE
(mandatory): the type of device that this code is running on, see below for more details.EINK_REFRESH_INTERVAL
: the frequency with which to do a "full" (as opposed to a "fast") refresh on eInk displays that support variable update speed. Defaults to60
.EINK_UPDATE_SPEED
: the speed for regular ("fast") refreshes on eInk displays that support variable update speed. Defaults to2
. See Pimoroni's GitHub for more details.LOG_DEBUG
: whether to log "debug" level messages. Defaults tofalse
, as these are very "chatty".LOG_LIMIT
: the number of log entries to store. Defaults to100
.NTP_HOST
: the host of the NTP server to use to sync the internal clock. Defaults totime.cloudflare.com
(Cloudflare Time Services).NTP_INTERVAL_HOURS
: the frequency (in hours) to sync the internal clock with the NTP server. Defaults to4
.WIFI_DEBUG_SHOW_HOSTNAME
: show the device hostname when connecting to WiFi. Defaults tofalse
.WIFI_DEBUG_SHOW_IP
: show the device IP address after connecting to WiFi. Defaults tofalse
.WIFI_DEBUG_SHOW_MAC
: show the device MAC address when connecting to WiFi. Defaults tofalse
.WIFI_DEBUG_SHOW_SSID
: show the WiFi SSID when connecting. Defaults totrue
.WIFI_DEBUG_SUCCESS_SECS
: show the WiFi success message for a certain number of seconds. Defaults to3
.WIFI_NETWORK
: the WiFi network name (SSID) to connect to.WIFI_PASSWORD
: the password (PSK) for the WiFi network.
For full details on supported devices see mpy/devices.py
.
- Pimoroni Badger 2040 W:
badger_2040
- Pimoroni Inky Frame 4:
inky_frame_4
- Pimoroni Inky Pack:
inky_pack
- Pimoroni Presto:
presto
main.py
: runs when the device is booted, initialisesApp
class.devices.py
: contains details about supported devices.app.py
: contains the logic required to display application data on the device, including state required for outputting to a display.hello.py
: our example "Hello" application, which contains its own state.