-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Badger 2040 display when connecting #30
Comments
https://github.com/pimoroni/badger2040/blob/main/badger_os/examples/news.py#L179 The example news app could (probably) take advantage of sleep if this was implemented |
I have a similar use case. I'm using wifimgr.py and modified it to work on badger. My approach Is to render the text in the top of the screen and then call I also use the LED as an indicator of activity: while True:
display.keepalive()
display.led(128) # brighter LED
render() # this does the data fetching and drawing
display.led(6) # dimmed LED (on USB)
badger2040.sleep_for(10) # on battery the LED goes completely off during sleep |
That status handler code is quite bad on two accounts- the Normally this is solved by passing in a custom handler when constructing |
Perfect, I have done something similar to @salimhb for now (though still using the config file rather than adding wifi creds in again. Would be happy to test anything! |
Okay, test build here - https://github.com/pimoroni/badger2040/actions/runs/5421334513 Now you can use:
Or define your own status handler in user code:
|
Thanks @Gadgetoid, looks like a good solution 👍 |
Yeah works well for me, I have added a comment on the PR though as the method still causes unexpected behaviour. Thanks for the super quick fix! |
Badger 2040W: Custom WiFi status handler for #30
This was resolved by the PR |
badger2040/firmware/PIMORONI_BADGER2040W/lib/badger2040.py
Lines 232 to 242 in 879f044
The 2040w is hard coded to take over the display when connecting, Could this be an option to light the LED or similar user defined action.
Example use case
Showing latest information from a website could look like
After waking up from sleep, the wifi needs to be connected again, taking ~10 seconds, so every 10 minutes, for 10 seconds the badge doesnt display the intended content. A user defined option could be doing an update partial to the screen or lighting the LED.
The text was updated successfully, but these errors were encountered: