A model railway throttle for the Pico.
- Pico W
- Kitronic Simply Robotics Motor Driver Board
- Power Supply (12V maximum)
- Locomotive (or any 12V motor)
-
Install Poetry
-
Setup Poetry
-
Run Ruff
python -m ruff check --fix
-
Run PyTest
python -m pytest
With thanks to SoongJr for the WiFi configuration and depedency installation scripts and instructions.
- Flash micropython onto your pico (you can get the latest build)
- Transfer and run
setup/configure-wifi.pyon the pico (after which you have to hit Ctrl+X to get out of REPL)This will prompt for credentials and write them into a file on the pico, so there is no chance you'll accidentally upload them to github.rshell 'cp setup/configure-wifi.py /pyboard; repl ~ exec(open("/configure-wifi.py").read())' - Run
python .\src\setup\sync.pyto transfer all files fromsrc/rp2to the pico board
Use the Pico Device Controller to run main.py, server.py, or one of the sandbox scripts.
The external library umqtt.simple is required to be loaded onto the Pico for data-logging work.
mpremote mip install umqtt.simpleIf a typing import error such as ImportError: no module named 'typing',
then install a mock typing module such as https://micropython-stubs.readthedocs.io/en/main/typing_mpy.html#install-the-typing-modules-to-your-mcu
mpremote mip install github:josverl/micropython-stubs/mip/typing.mpy- Lever Icon: Gambling icons created by Freepik - Flaticon
