A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/jamesmcm/snake_rust_esp32 below:

GitHub - jamesmcm/snake_rust_esp32: Snake running on an ESP32 MCU written in Rust

Snake for ESP32 with Rust

This project implements the game Snake for an ESP32 microcontroller, written in Rust.

This was written as a basic starter project.

Hardware:

Photo:

Video:

output.mp4

Wokwi project (note does not build there due to Rust dependencies): https://wokwi.com/projects/413450202628576257

Embassy is used to run concurrent tasks (checking for input at a faster rate than the game update rate).

The joystick URX and URY axes inputs are handled with a built-in Analogue-Digital Converter (be careful about the choice of GPIO pins as the selection is limited). And the button click is handled with an interrupt.

Deployment

Install Rust and espup.

Then run:

$ source ~/export-esp.sh
$ cargo run --release
Simulation

Install Wokwi for VS Code. Open diagram.json and click Play button.

Notes

Note the input voltage to the joystick had to be lowered via a voltage divider to get a usable range, the voltage divider here used one 1k and one 2k Ohm resistors to the 5V input.

Note the SCL and SDA pins to the I2C display needed pull-up resistors, here I used 2k Ohm resistors to 5V.

Known Issues Resources

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4