add some button noises

This commit is contained in:
sigil-03 2025-10-26 18:08:26 -06:00
parent 9f12502a3d
commit 17c82e5a6c
4 changed files with 17 additions and 7 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -375,9 +375,12 @@ fn app_main(mut p: hal::Peripherals, mut delay: Delay) -> ! {
// dac data
// let coin_sound = include_bytes!("../audio/coin.raw");
let coin_sound = include_bytes!("../audio/sweep_dpcm_u4.raw");
let button_sounds = [include_bytes!("../audio/sweep_dpcm_u4.raw")];
// let button_sound = include_bytes!("../audio/coinMixTest1_dpcm_u4.raw");
// let coin_sound = include_bytes!("../audio/sweep_dpcm_u4.raw");
let coin_sound = include_bytes!("../audio/button_1.raw");
let button_sound_1 = include_bytes!("../audio/button_1.raw");
let button_sound_2 = include_bytes!("../audio/button_2.raw");
let button_sound_3 = include_bytes!("../audio/button_3.raw");
let mut system_state = SystemState::Active;
@ -483,12 +486,19 @@ fn app_main(mut p: hal::Peripherals, mut delay: Delay) -> ! {
println!("debounced button_input value: {}", value);
if !value {
interfaces
.dac
.load_data(button_sounds[settings.button_sound_index]);
interfaces.dac.load_data(match settings.button_sound_index {
0 => button_sound_1,
1 => button_sound_2,
2 => button_sound_3,
_ => button_sound_1,
});
// interfaces
// .dac
// .load_data(button_sounds[settings.button_sound_index]);
settings.button_sound_index += 1;
if settings.button_sound_index > button_sounds.len() - 1 {
if settings.button_sound_index > 2 {
// if settings.button_sound_index > button_sounds.len() - 1 {
settings.button_sound_index = 0;
}
#[cfg(feature = "enable_print")]