✅ Modify the code so the RGB LED light changes to different random color upon each button press. The LED should not go out or change color if the button is not pressed for some time.
Continue by adding to your previous solution or the code from
You can find the solution for this exercise in
- The necessary imports are already made, if you enter
cargo --doc --openyou will get helping documentation regarding the LED.
- The LED's part number is WS2812RMT.
- It's a programmable RGB LED. This means there aren't single pins to set for red, green and blue, but that we need to instantiate it to be able to send
RGB8type values to it with a method.
- The board has a hardware random number generator. It can be called with
- Calling functions from the
esp-idf-sysis unsafe in Rust terms and requires an
unsafe()block. You can assume that these functions are safe to use, so no other measures are required.