Hi,
i try to program an interface with several pushbutton triggered functions. there is the main loop, and inside there should be another condition with a lot of action (i reduced it in my code to “play_frequency(2000, 60, 13);”), triggered by the TOP_BUTTON. but before this action starts, i want to trigger another small function by a pushbutton. this function behaves correct, but the “TOP_BUTTON” - triggered function does not start. can you have a look at my source code?
thanks!
int main()
{
while (1){
if (get_single_debounced_button_press(ANY_BUTTON) == MIDDLE_BUTTON)
play_frequency(8000, 60, 13);
if (get_single_debounced_button_release(ANY_BUTTON) == MIDDLE_BUTTON)
play_frequency(4000, 60, 13);
}
if (get_single_debounced_button_press(ANY_BUTTON) == TOP_BUTTON){
play_frequency(2000, 60, 13);
}
}