Skip to content

Latest commit

 

History

History
64 lines (45 loc) · 1.46 KB

File metadata and controls

64 lines (45 loc) · 1.46 KB

rshell MicroPython connection

rshell Python program is used to test and upload Python scripts on the Pico console. If the script is named "main.py", it will autorun when the Pico starts.

NOTE: don't use "sudo" when installing rshell, this is adequate:

pip install rshell

Specify the port of the Pico like:

  • macOS: rshell -p /dev/tty.usbmodem*
  • Linux: rshell -p /dev/ttyACM*
  • Windows: rshell -p COM3 (look in Windows Device Manager under "Ports")

If rshell can't connect, try resetting Pico power (unplug, plug USB) and ensure MicroPython is installed on the Pico.

Check which board(s) are connected:

boards

pyboard @ /dev/tty.usbmodem12201

Start REPL on the Pico from rshell:

repl

Entering REPL. Use Control-X to exit. MicroPython; Raspberry Pi Pico with RP2040 Type "help()" for more information.

Copy a Python script to the Pico. Any script named "main.py" runs automatically when the Pico is powered on or reset.

cp ../pico-micropython-examples/adc/temperature.py /pyboard/main.py

Copying 'pico-micropython-examples/adc/temperature.py' to '/pyboard/main.py' ...

Then press type

repl

and press Control-D to restart the Pico and the main.py program runs. The "adc/temperature.py" script prints the onboard temperature in Celsius every 2 seconds.

19.55409 20.02224