Finish slideshow
This commit is contained in:
parent
a634c9230c
commit
bc944008a8
BIN
images/Image.bmp
BIN
images/Image.bmp
Binary file not shown.
Before Width: | Height: | Size: 8.1 KiB |
BIN
images/Image.qoi
BIN
images/Image.qoi
Binary file not shown.
BIN
images/Image.xcf
BIN
images/Image.xcf
Binary file not shown.
BIN
images/hi.qoi
BIN
images/hi.qoi
Binary file not shown.
BIN
images/hi.xcf
BIN
images/hi.xcf
Binary file not shown.
BIN
images/large.qoi
BIN
images/large.qoi
Binary file not shown.
BIN
images/large.xcf
BIN
images/large.xcf
Binary file not shown.
BIN
images/mario.xcf
BIN
images/mario.xcf
Binary file not shown.
BIN
images/sheep.qoi
BIN
images/sheep.qoi
Binary file not shown.
BIN
images/sheep.xcf
BIN
images/sheep.xcf
Binary file not shown.
BIN
images/steve.qoi
Normal file
BIN
images/steve.qoi
Normal file
Binary file not shown.
16
src/main.rs
16
src/main.rs
@ -20,7 +20,7 @@ use panic_halt as _;
|
|||||||
use crate::{
|
use crate::{
|
||||||
display::{Display, Position, Rgb565},
|
display::{Display, Position, Rgb565},
|
||||||
peripherals::{Button, Knob},
|
peripherals::{Button, Knob},
|
||||||
qoi::{MARIO, PIKA, PRESS_BTN, draw_image},
|
qoi::{MARIO, PIKA, PRESS_BTN, STEVE, draw_image},
|
||||||
};
|
};
|
||||||
|
|
||||||
mod display;
|
mod display;
|
||||||
@ -49,7 +49,7 @@ fn main() -> ! {
|
|||||||
// ufmt::uwriteln!(serial, "Eeprom capacity: {}", eeprom.capacity()).unwrap();
|
// ufmt::uwriteln!(serial, "Eeprom capacity: {}", eeprom.capacity()).unwrap();
|
||||||
|
|
||||||
let cs = pins.pb2.into_output();
|
let cs = pins.pb2.into_output();
|
||||||
let (mut spi, mut cs) = spi::Spi::new(
|
let (spi, cs) = spi::Spi::new(
|
||||||
dp.SPI,
|
dp.SPI,
|
||||||
pins.pb5.into_output(),
|
pins.pb5.into_output(),
|
||||||
pins.pb3.into_output(),
|
pins.pb3.into_output(),
|
||||||
@ -75,23 +75,15 @@ fn main() -> ! {
|
|||||||
|
|
||||||
display.init();
|
display.init();
|
||||||
|
|
||||||
let mut adc: Adc<CoreClock> = atmega_hal::Adc::new(dp.ADC, Default::default());
|
|
||||||
|
|
||||||
let mut button = Button::from(pins.pd5.into_pull_up_input());
|
let mut button = Button::from(pins.pd5.into_pull_up_input());
|
||||||
let mut knob = Knob {
|
|
||||||
pin: pins.pc1.into_analog_input(&mut adc),
|
|
||||||
adc,
|
|
||||||
};
|
|
||||||
|
|
||||||
let mut delay = atmega_hal::delay::Delay::<CoreClock>::new();
|
|
||||||
|
|
||||||
let mut idx = 0;
|
let mut idx = 0;
|
||||||
let mut images = [&PIKA.as_slice(), &MARIO.as_slice()];
|
let images = [&PIKA.as_slice(), &MARIO.as_slice(), &STEVE.as_slice()];
|
||||||
let len = images.len();
|
let len = images.len();
|
||||||
|
|
||||||
match draw_image(
|
match draw_image(
|
||||||
&mut serial,
|
&mut serial,
|
||||||
&PRESS_BTN.as_slice(),
|
&PIKA.as_slice(),
|
||||||
&mut display,
|
&mut display,
|
||||||
Position { x: 0, y: 0 },
|
Position { x: 0, y: 0 },
|
||||||
) {
|
) {
|
||||||
|
@ -19,6 +19,7 @@ use crate::{
|
|||||||
// https://qoiformat.org/qoi-specification.pdf
|
// https://qoiformat.org/qoi-specification.pdf
|
||||||
pub static MARIO: [u8; 161] = *include_bytes!("../images/mario.qoi");
|
pub static MARIO: [u8; 161] = *include_bytes!("../images/mario.qoi");
|
||||||
pub static PIKA: [u8; 241] = *include_bytes!("../images/pikachu.qoi");
|
pub static PIKA: [u8; 241] = *include_bytes!("../images/pikachu.qoi");
|
||||||
|
pub static STEVE: [u8; 187] = *include_bytes!("../images/steve.qoi");
|
||||||
pub static PRESS_BTN: [u8; 174] = *include_bytes!("../images/press_btn.qoi");
|
pub static PRESS_BTN: [u8; 174] = *include_bytes!("../images/press_btn.qoi");
|
||||||
|
|
||||||
#[derive(Debug, uDebug)]
|
#[derive(Debug, uDebug)]
|
||||||
|
Loading…
Reference in New Issue
Block a user