Hi,
I have not been able to get the push buttons to work correctly on my X2. The example button project works fine, but if I copy and paste that code into my project (e.g. to wait for BUTTON_A), it will not work. I have the same include files.
This is the code I am trying to use:
unsigned char wait_for_button_and_beep()
{
unsigned char button = wait_for_button_press(ANY_BUTTON);
if(button & TOP_BUTTON)
{
play_from_program_space(beep_button_top);
}
else if(button & MIDDLE_BUTTON)
{
play_from_program_space(beep_button_middle);
}
else
{
play_from_program_space(beep_button_bottom);
}
wait_for_button_release(button);
return button;
}
Does anyone have some working sample code that will wait for a single button press on the X2? I’d like to try it in my project to see if it works. Or could anyone explain how the orangutan library deals with button presses and what I need to do to wait for one?
Thank you,
Ryan