The XRP Controller Board includes a "USER Button" which we can use to control our robot.
Find the USER button on your XRP --->
Note there are 2 other buttons on the Pico board:
The "BOOT" button is used to update the firmware.
The "RESET" stops the running program and resets the Python interpretor.
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?