reset the game lib
This commit is contained in:
parent
d6ba3b5026
commit
5df6d9e67b
1 changed files with 7 additions and 1 deletions
|
@ -4,8 +4,10 @@
|
||||||
//Include the Arduboy Library
|
//Include the Arduboy Library
|
||||||
#[allow(unused_imports)]
|
#[allow(unused_imports)]
|
||||||
use arduboy_rust::prelude::*;
|
use arduboy_rust::prelude::*;
|
||||||
|
use arduboy_tone::arduboy_tone_pitch::*;
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
const arduboy: Arduboy2 = Arduboy2::new();
|
const arduboy: Arduboy2 = Arduboy2::new();
|
||||||
|
const sound: ArduboyTones = ArduboyTones::new();
|
||||||
|
|
||||||
// Progmem data
|
// Progmem data
|
||||||
|
|
||||||
|
@ -18,6 +20,7 @@ pub unsafe extern "C" fn setup() {
|
||||||
arduboy.begin();
|
arduboy.begin();
|
||||||
arduboy.set_frame_rate(30);
|
arduboy.set_frame_rate(30);
|
||||||
arduboy.clear();
|
arduboy.clear();
|
||||||
|
sound.volume_mode(VOLUME_ALWAYS_NORMAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
// The loop() function repeats forever after setup() is done
|
// The loop() function repeats forever after setup() is done
|
||||||
|
@ -28,6 +31,9 @@ pub unsafe extern "C" fn loop_() {
|
||||||
if !arduboy.next_frame() {
|
if !arduboy.next_frame() {
|
||||||
return;
|
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();
|
arduboy.display();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue