Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vpayno/microbit-workspace
Personal workspace for learning to use the Microbit with Rust, TinyGo and Python
https://github.com/vpayno/microbit-workspace
microbit-v2 micropython rust tinygo
Last synced: 9 days ago
JSON representation
Personal workspace for learning to use the Microbit with Rust, TinyGo and Python
- Host: GitHub
- URL: https://github.com/vpayno/microbit-workspace
- Owner: vpayno
- License: mit
- Created: 2024-05-10T19:03:26.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-05-23T04:55:13.000Z (6 months ago)
- Last Synced: 2024-05-23T05:24:50.119Z (6 months ago)
- Topics: microbit-v2, micropython, rust, tinygo
- Language: Python
- Homepage:
- Size: 176 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# microbit-workspace
[![rust](https://github.com/vpayno/microbit-workspace/actions/workflows/rust.yml/badge.svg?branch=main)](https://github.com/vpayno/microbit-workspace/actions/workflows/rust.yml)
[![actionlint](https://github.com/vpayno/microbit-workspace/actions/workflows/gh-actions.yml/badge.svg?branch=main)](https://github.com/vpayno/microbit-workspace/actions/workflows/gh-actions.yml)
[![spellcheck](https://github.com/vpayno/microbit-workspace/actions/workflows/spellcheck.yml/badge.svg?branch=main)](https://github.com/vpayno/microbit-workspace/actions/workflows/spellcheck.yml)Personal workspace for learning to use the Microbit with Rust, TinyGo and Python.
## Links
- [Microbit GitHub](https://github.com/bbcmicrobit)
- [Microbit Adafruit](https://learn.adafruit.com/category/micro-bit)
- [Rust](https://github.com/nrf-rs/microbit)
- [TinyGo](https://tinygo.org/docs/reference/microcontrollers/microbit/)
- [MicroPython](https://github.com/bbcmicrobit/micropython)## Experiments
- [Rust](./rust/README.md)
- [TinyGo](./tinygo/README.md)
- [MicroPython](./python/README.md)## RunMe Playbook
This and other readme files in this repo are RunMe Playbooks.
Use this playbook step/task to update the [RunMe](https://runme.dev) CLI.
If you don't have RunMe installed, you'll need to copy/paste the command. :)
```bash { background=false category=runme closeTerminalOnSuccess=true excludeFromRunAll=true interactive=true interpreter=bash name=setup-install-runme promptEnv=true terminalRows=10 }
go install github.com/stateful/runme/v3@v3
```Install Playbook dependencies:
```bash { background=false category=runme closeTerminalOnSuccess=true excludeFromRunAll=true interactive=true interpreter=bash name=setup-runme-deps promptEnv=true terminalRows=10 }
go install github.com/charmbracelet/gum@latest
```## Installing Tools
Install generic tools dependencies.
```bash { background=false category=setup closeTerminalOnSuccess=true excludeFromRunAll=true interactive=true interpreter=bash name=setup-install-tools-generic promptEnv=true terminalRows=10 }
# install generic tool dependenciesset -e
set -xprintf "\n"
sudo nala install --no-autoremove -y gcc-arm-none-eabi
set +x
```Install Rust language dependencies.
```bash { background=false category=setup closeTerminalOnSuccess=true excludeFromRunAll=true interactive=true interpreter=bash name=setup-install-tools-rust promptEnv=true terminalRows=10 }
# install rust language dependenciesset -e
set -xprintf "\n"
sudo nala install --no-autoremove -y gcc-arm-none-eabi
cargo install probe-rs
cargo install flip-linkset +x
```Install TinyGo language dependencies.
```bash { background=false category=setup closeTerminalOnSuccess=true excludeFromRunAll=true interactive=true interpreter=bash name=setup-install-tools-tinygo promptEnv=true terminalRows=10 }
# install tinygo language dependenciesset -e
set -xprintf "\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](https://docs.micropython.org/en/latest/reference/packages.html), learning to use `mip` and `mpremote`.
Adafruit MicroPython tutorials:
- [Firmware Loading](https://learn.adafruit.com/micropython-basics-how-to-load-micropython-on-a-board)
Install Python/MicroPython language dependencies.
```bash { background=false category=setup closeTerminalOnSuccess=true excludeFromRunAll=true interactive=true interpreter=bash name=setup-install-tools-micropython promptEnv=true terminalRows=10 }
# install python/micropython language dependenciesset -e
set -xprintf "\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 mpremoteif [[ ! -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 pkgnamepdm 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
```