Skip to content

vaibhavbafna5/snake

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Snake

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

Building & Flashing

  1. Buy the hardware
  2. Clone the repo
  3. Install dependencies (cargo install --path .)
  4. Build & flash (cargo embed --features v2 --target thumbv7em-none-eabihf)

Playing

I run MacOS, so I use minicom to open a serial interface to the microbitV2.

  1. Run ls /dev/cu.usbmodem* to find the device identifier (should look something like /dev/cu.usbmodem2102)
  2. To open the port, run minicom -D /dev/cu.usbmodem2102 -b 115200
  3. And then to move the snake around, use the i, j, k, l keys

Index

  1. Vanilla Intro to Rust
  2. Discovery AKA Rust on microbitV2

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published