This project was accepted as an example on the rust atsamd repo. This is the PR which was accepted.
This project implements the generic snake game for the arm based Wio Terminal embedded system. It was made possible with the help of examples in the atsamd_hal/boards/wio_terminal repository. Some code, say, for pin, display, etc. initializations has been taken from the aforementioned repository. The coordinates for the food cells in the game are generated by a lightweight pseudo-random number generation crate.
If the gif does not load, check it out here!
The direction of the snake is controlled by the 5-Way-Switch (the round button just below the LCD screen).
First step would be to add the proper udev rules for flashing. Refer to udev-rules bit of this snippet. Then, you can do:
$ cargo build --release
$ arm-none-eabi-objcopy -O binary target/thumbv7em-none-eabihf/release/snake snake.bin
$ bossac -p ttyACM0 -e -w -v --offset=0x4000 snake.bin
You may also follow this snippet to help you build and flash the rust program.
MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)