The XRP Controller Board includes a "User Button" which we can use to control our robot.
Find the user button on your XRP --->
(Note that the "BOOTSEL" button on the Pico board is a different button. It is used to update the firmware.)
The user button is connected to pin 22 on the Pico, which is also wired to the "Extra" connector.
Create the program shown here -->
Run the program
How does this work?
View the generated Python code:
View the generated Python code:
from XRPLib.board import Board
import time
board = Board.get_default_board()
while True:
board.wait_for_button()
board.led_on()
time.sleep(0.5)
board.led_off()
Notice that the XRPLib library Board module includes functions for the button and the internal LED.
For the details, see the XRPLib API reference:
https://open-stem.github.io/XRP_MicroPython/index.html ... Board
Do this in Blockly or MicroPython. Your choice.
Change the program so that the LED turns off when the button is pressed
When the user button is pressed, blink the LED 5 times
Press the button to toggle the LED (on -> off, off -> on)
Your ideas?