Shipped this project!
This is custom firmware for the sprig! My initial proof of concept was written in c++, since this is what the stock sprig firmware is written in, but I moved over to rust once I had a good understanding of the hardware.
Log in to leave a comment
Log in to leave a comment
Log in to leave a comment
Log in to leave a comment
Finally figured out how I want to do the systems in rust, since it becomes a lot harder when you need to deal with those memory safety design choices - for example, where do you construct the Input object needed within a Button class? Is it for the class to internalise or should it be handled by the constructor? If it needs to be referenced mutably in multiple places (eg. the debouncing task), how should it be handled? You cannot call the input.wait_for_high() without input being mutable, but you can poll for is_high() with an immutable input, which is what occurs internally in the wait_for_high() anyway…
The demo shown in the video is waiting for the button to be held (considered held when pressed down for >800ms) and then flashing the pico built in LED for 5ms. This isn’t a static demo, the logic for debouncing, detecting press vs hold, etc is encapsulated within a new Button class.
Log in to leave a comment
Log in to leave a comment
Cool! I am working on a sprig project too!
NB. The firmware is displaying a hackclub logo immediately after the loading bar and before badapple!! plays, but it doesn’t show on the video very well. When viewed on the device, it looks just how you would expect.
Log in to leave a comment
In the video, you can see a demo of the audio beep and the SD card detection. Note that the hackclub logo is being read from the SD card, it is not stored on the device. This is why it requires that the user insert an SD card.
Since I received a PicoWH with my sprig (was that intended?), next I will add an option to automatically download and populate the SD card inserted if not already populated.
Log in to leave a comment
Log in to leave a comment
Got the pico environment set up and made a quick demo to check that I could interact with the sprig hardware. Also added some code so that the BOOTSEL button can be pressed while the program is running to immediately enter flashing mode.
Log in to leave a comment