An implementation of the game snake in Rust, designed to be played on a microbitV2.
This project was used as an introduction to the embedded Rust ecosystem following completion of the vanilla introduction to Rust. It's very much still a work-in-progress, but major functionality is there.
Current functionality:
- read directional input from serial
- move the snake around (and turns will persist)
- eating "nuggets" works and the snake will enlargen
Future work:
- read the accelerometer to control the direction the snake moves
- restart the game automatically on "death"
- address warnings generated by compiler
- Buy the hardware
- Clone the repo
- Install dependencies (
cargo install --path .
) - Build & flash (
cargo embed --features v2 --target thumbv7em-none-eabihf
)
I run MacOS, so I use minicom to open a serial interface to the microbitV2.
- Run
ls /dev/cu.usbmodem*
to find the device identifier (should look something like/dev/cu.usbmodem2102
) - To open the port, run
minicom -D /dev/cu.usbmodem2102 -b 115200
- And then to move the snake around, use the
i, j, k, l
keys
- Vanilla Intro to Rust
- Discovery AKA Rust on microbitV2