I’m looking for pointers on how to port a badger2040 MicroPython app to the Badger2350
We have a program called MoodBadger that aids the neurodivergent in expressing an emotional state via icons. It currently runs as the only app on the 2040 Badger. I’d like to migrate the app to the new Badger2350 (e-ink) either as a standalone or as an app in the app set.
The application is a single Python file plus an icon directory and two JSON files. One for configuration and one for updatable state that is saved before a badger2040.turnOff() call. The app uses these Python libraries
The Badger2040 had some circuitry that did cut power to the device, so the Badger2040 was really off. The Badger2350 is a step backward in this respect: it only switches to deep-sleep. You will notice this if you have very long off-times: power draw of the Badger2350 is probably 5-10 times higher in deep-sleep compared to the off-state of the Badger2040.
If you port your application to an app in the app set as you call it, you probably get the switch to deep-sleep automatically. For a standalone application, you need to call the appropriate method yourself.
There’s really quite a lot that’s changed and the new API is a lot more powerful than the old, so it may be worth thinking about rewriting from the ground up to take advantage of that while keeping things user friendly.
As far as sleeping goes, it’s as bablokb says - the badge goes into a deep sleep mode after a few seconds of inactivity. That’s accomplished simply using badge.sleep(), which will wake it up on a button press.
This is a fantastic use of these badges, and my initial beginner’s tutorial (offline at time of writing as I’m updating it to the new firmware version) was written with a view to being easily modifiable for this kind of application. Let me know if there’s anything else you need!