reset the game lib

This commit is contained in:
ZennDev1337 2023-09-18 16:24:18 +02:00
parent d6ba3b5026
commit 5df6d9e67b

View file

@ -4,8 +4,10 @@
//Include the Arduboy Library
#[allow(unused_imports)]
use arduboy_rust::prelude::*;
use arduboy_tone::arduboy_tone_pitch::*;
#[allow(dead_code)]
const arduboy: Arduboy2 = Arduboy2::new();
const sound: ArduboyTones = ArduboyTones::new();
// Progmem data
@ -18,6 +20,7 @@ pub unsafe extern "C" fn setup() {
arduboy.begin();
arduboy.set_frame_rate(30);
arduboy.clear();
sound.volume_mode(VOLUME_ALWAYS_NORMAL);
}
// The loop() function repeats forever after setup() is done
@ -28,6 +31,9 @@ pub unsafe extern "C" fn loop_() {
if !arduboy.next_frame() {
return;
}
sound.tone3(NOTE_C3, 500, NOTE_D3, 250, NOTE_E3, 1000);
delay(2000);
sound.tone2(NOTE_C3, 500, NOTE_D3, 250);
delay(2000);
arduboy.display();
}