diff --git a/README.md b/README.md index 525b869..d140bd1 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,16 @@ -# Slideshow +# Dice game -This project is a relatively simple slideshow running on the Adafruit Feather -328P (an ATmega328p-microcontroller) using a simple button and a 240x240 LCD -display with the ST7789-driver over +This project is a simple dice-game running on the Adafruit Feather 328P (an +ATmega328p-microcontroller) using a simple button and a 240x240 LCD display with +the ST7789-driver over [SPI](https://en.wikipedia.org/wiki/Serial_Peripheral_Interface). +In the game you roll a number between 1 and 10, and if you get a 10, you are +awarded a picture of a high-quality cat stored in program-memory! + +This project is a direct continuation of my earlier +[slideshow](https://git.teascade.net/teascade/slideshow) + This project is written on Rust and uses a very minimal amount of libraries with the most significant being [`atmega-hal`](https://github.com/Rahix/avr-hal), a hardware abstraction layer for ATmega-microcontrollers. Images are stored in the diff --git a/demonstration.mp4 b/demonstration.mp4 index 4311c5d..eae8498 100644 Binary files a/demonstration.mp4 and b/demonstration.mp4 differ diff --git a/src/main.rs b/src/main.rs index 7eca3c9..0e4f734 100644 --- a/src/main.rs +++ b/src/main.rs @@ -11,11 +11,12 @@ use core::ptr::addr_of; use atmega_hal::{ - Adc, Usart, + Adc, Usart, Wdt, adc::AdcSettings, delay, spi::{self, Settings}, - usart::Baudrate, + usart::{Baudrate, UsartOps}, + wdt::WdtOps, }; use embedded_hal::delay::DelayNs; use panic_halt as _; @@ -114,6 +115,7 @@ fn main() -> ! { let mut animation_reached = true; let mut cat_received = false; let max_number = 10; + loop { clock += 1; if button.poll() {