1 unstable release
0.0.3 | Jan 16, 2023 |
---|---|
0.0.2 |
|
0.0.1 |
|
#951 in Embedded development
26KB
241 lines
thumby-rs
This is a Rust crate that may be used to interface with the TinyCircuits Thumby device.
Downloading an installing the binary
- Navigate to the releases page.
- Download the
.uf2
file from theAssets
dropdown. - Make sure your Thumby is in BOOTSEL mode
- Power on your Thumby by toggling the switch on top to the right.
- While holding the
down
button on the D-pad, switch your Thumby off by toggling the switch to the left. - While continuing to hold the
down
button, power on your Thumby again. - Your Thumby should now be mounted on your system.
- Move the downloaded
.uf2
file to your mounted Thumby. It should automatically unmount itself.
Instructions for downloading and running examples
- Download Rust.
- Run the
setup.sh
script. This requires Bash CLI, which on Windows may be obtained through Git Bash. - Make sure your Thumby is in BOOTSEL mode
- Power on your Thumby by toggling the switch on top to the right.
- While holding the
down
button on the D-pad, switch your Thumby off by toggling the switch to the left. - While continuing to hold the
down
button, power on your Thumby again. - Your Thumby should now be mounted on your system.
- Optional: Install Visual Studio Code.
- Clone this repository:
git clone https://github.com/jngo102/thumby-rs
- If you installed Visual Studio Code, you can quickly deploy to your mounted Thumby by opening the command palette
(Ctrl/Cmd+Shift+P)
, executing theDeploy to Thumby
task, then answering the prompts. - If you did not install Visual Studio Code, you may open a terminal, navigate to the path of the cloned repository:
cd /path/to/thumby-rs
, and run the commandcargo build --example {exampleName}
, where{exampleName}
should be replaced with the name of an example that may be found in the examples folder. - After the build is complete, navigate to the produced binary:
cd ./target/thumbv6m-none-eabi/debug/examples/{exampleName}
- Run the command
elf2uf2-rs {exampleName}
to turn the ELF binary into a UF2 binary that may be used by the Thumby. - Copy the resulting UF2 file into the location of your mounted Thumby. It should automatically unmount itself.
Using this crate in a project
- Clone the rp2040-hal template project to your computer.
- Open the cloned folder in an IDE.
- In the
Cargo.toml
file, under[dependencies]
, addthumby = "^0"
. - You may now start importing thumby-rs modules to use in your game.
- If you have Visual Studio Code, it is recommended to have the rust-analyzer extension installed.
Dependencies
~9MB
~174K SLoC