Eg. int choice=yn_dialog(“Engage death ray now?”);
Yes, so why did you get rid of the variable that holds the response? The way you have it you are calling the function but discarding the result.
My apologies I got it wrong in the second part of the code, my intention is to change from a yes/no to just a OK. the changed code should be...
void top_menu_function_5() //Replace this with the actual function of menu item #5
//lcd.print(choice); // Display the user choice one more time
int motorspeed = 100; // This sets up the speed the motor will turn
motor2.step(user_input3, BACKWARD, SINGLE); //Move the motor forward by the number of "Steps per frame
motor2.release(); // make sure the motor is at rest.
And the extract from the document...
12) int ok_dialog(char msg);
This renders an OK dialog. Primarily you want to show the user a message and the user needs to press a key to continue. Otherwise the function keeps waiting. It doesn‟t actually return a value. The return value type is there to be consistent with the YES/NO dialog and any future dialog functions. The OK dialog just needs the char array that has the message to show to the user. The message will be truncated if there is not enough space. The dialog auto scales to occupy the entire display so you don‟t have to specify you have a 20X4 display or 16*2 display. See fig. 6-2 below.
Eg. ok_dialog(“Death ray was engaged. Annihilation in progress...”);