Personal workspace for learning to use the Microbit with Rust, TinyGo and Python.
This and other readme files in this repo are RunMe Playbooks.
Use this playbook step/task to update the RunMe CLI.
If you don't have RunMe installed, you'll need to copy/paste the command. :)
go install github.com/stateful/runme/v3@v3
Install Playbook dependencies:
go install github.com/charmbracelet/gum@latest
Install generic tools dependencies.
# install generic tool dependencies
set -e
set -x
printf "\n"
sudo nala install --no-autoremove -y gcc-arm-none-eabi
set +x
Install Rust language dependencies.
# install rust language dependencies
set -e
set -x
printf "\n"
sudo nala install --no-autoremove -y gcc-arm-none-eabi
cargo install probe-rs
cargo install flip-link
set +x
Install TinyGo language dependencies.
# install tinygo language dependencies
set -e
set -x
printf "\n"
sudo nala install --no-autoremove -y gcc-arm-none-eabi
go install github.com/tinygo-org/tinygo@latest
set +x
For MicroPython Package Management, learning to use mip
and mpremote
.
Adafruit MicroPython tutorials:
Install Python/MicroPython language dependencies.
# install python/micropython language dependencies
set -e
set -x
printf "\n"
sudo nala install --no-autoremove -y gcc-arm-none-eabi cmake ninja-build srecord libssl-dev yotta
printf "\n"
python --version
pip install --upgrade mpremote
if [[ ! -d .venv ]]; then
latest_python_version="$(pyenv versions --bare | grep '^3[.]' | sort -V | tail -n 1)"
pyenv local "${latest_python_version}"
pyenv local
printf "\n"
latest_mp_version="$(pyenv versions --bare | grep micropython | sort -V)"
if ! pyenv versions | grep -q "${latest_mp_version}"; then
pyenv install "${latest_mp_version}"
pyenv versions
fi
printf "\n"
# can't use pdm with micropython
# pyenv local "${latest_mp_version}"
# pyenv local
# printf "\n"
pyenv versions
printf "\n"
# instead of pip use
# micropython -m mip install pkgname
pdm venv create -w virtualenv --with-pip python
printf "\n"
pdm use python
printf "\n"
fi
# create lock file
pdm lock
printf "\n"
# use lock file to update .venv
pdm sync
printf "\n"
set +x