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.