Difficulties incorporating stepper motor control example into larger program

Hi everyone! I'm still pretty new to Arduino, but am learning heaps!

I am using the EasyDriver Stepper motor driver as part of a larger project and as such I am trying to incorporate the stepper motor control example into a larger program (which, up until that point compiled & worked). However when I compile the new code, I get the error that "rotate was not declared in this scope". I thought maybe I needed to include the Stepper.h library, but to no avail. I was under the impression that a function did not need to be declared?

Feeling a bit confused......

The project is using a menu system to select & control the drink size and brew time of coffee, ala Clover. The menu system is working well so far & I am now attempting to interface the menu to the stepper.

Any pointers would be very welcome!

Well you really need to post your complete sketch for anyone to be able to help.

I was under the impression that a function did not need to be declared?

All functions have to be declared somewhere in the sketch or via a included file. What the arduino IDE does for you is not require you to use a function protype declaration before you use the function's name, the actual function can be declared at the end of the sketch if you wish. In standard C you must either declare the function before using it's name, or enter a function protype before using it's name in the sketch. At least that's my understanding, still learning to code.

Lefty

Thanks for your reply Lefty. Unfortunately on my first post I went over the character limit! So here is (the first part of) my borrowed & modified code thus far

/*
    Copyright Giuseppe Di Cillo (www.coagula.org)
    Contact: dicillo@coagula.org
    
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

/*
IMPORTANT: to use the menubackend library by Alexander Brevig download it at http://www.arduino.cc/playground/uploads/Profiles/MenuBackend_1-4.zip and add the next code at line 195
	void toRoot() {
		setCurrent( &getRoot() );
	}
*/

#include <MenuBackend.h>    //MenuBackend library - copyright by Alexander Brevig
#include <LiquidCrystal.h>  //this library is included in the Arduino IDE
#include <Stepper.h>

int DIR_PIN=12; //stepper motor direction pin
int STEP_PIN=13; //stepper motor step pin
int SLEEP_PIN=7;//stepper motor sleep pin


const int buttonPinLeft = 8;      // pin for the Up button
const int buttonPinRight = 9;    // pin for the Down button
const int buttonPinEsc = 10;     // pin for the Esc button
const int buttonPinEnter = 11;   // pin for the Enter button

int lastButtonPushed = 0;

int lastButtonEnterState = LOW;   // the previous reading from the Enter input pin
int lastButtonEscState = LOW;   // the previous reading from the Esc input pin
int lastButtonLeftState = LOW;   // the previous reading from the Left input pin
int lastButtonRightState = LOW;   // the previous reading from the Right input pin


long lastEnterDebounceTime = 0;  // the last time the output pin was toggled
long lastEscDebounceTime = 0;  // the last time the output pin was toggled
long lastLeftDebounceTime = 0;  // the last time the output pin was toggled
long lastRightDebounceTime = 0;  // the last time the output pin was toggled
long debounceDelay = 250;    // the debounce time

// LiquidCrystal display with:
// rs on pin 7
// rw on ground
// enable on pin 6
// d4, d5, d6, d7 on pins 5, 4, 3, 2
LiquidCrystal lcd(2, 3, 4, 5, 6, 7);

//Menu variables
MenuBackend menu = MenuBackend(menuUsed,menuChanged);
//initialize menuitems
    MenuItem menu1Item1 = MenuItem("Drink Size");
      MenuItem menuItem1SubItem1 = MenuItem("16 oz Iced");
      MenuItem menuItem1SubItem2 = MenuItem("12 oz Hot");
      MenuItem menuItem1SubItem3 = MenuItem("16 oz Hot");
      MenuItem menuItem1SubItem4 = MenuItem("Rinse     ");
    MenuItem menu1Item2 = MenuItem("Brew Time");
      MenuItem menuItem2SubItem1 = MenuItem("40 sec     ");
      MenuItem menuItem2SubItem2 = MenuItem("41 sec     ");
      MenuItem menuItem2SubItem3 = MenuItem("42 sec     ");
      MenuItem menuItem2SubItem4 = MenuItem("43 sec     ");
      MenuItem menuItem2SubItem5 = MenuItem("44 sec     ");
      MenuItem menuItem2SubItem6 = MenuItem("45 sec     ");
      MenuItem menuItem2SubItem7 = MenuItem("46 sec     ");
      MenuItem menuItem2SubItem8 = MenuItem("47 sec     ");
      MenuItem menuItem2SubItem9 = MenuItem("48 sec     ");
      MenuItem menuItem2SubItem10 = MenuItem("49 sec     ");
      MenuItem menuItem2SubItem11 = MenuItem("50 sec     ");
      MenuItem menu1Item3 = MenuItem("Temp");
      MenuItem menuItem3SubItem1 = MenuItem("201F     ");
      MenuItem menuItem3SubItem2 = MenuItem("202F     ");
      MenuItem menuItem3SubItem3 = MenuItem("203F     ");
      MenuItem menuItem3SubItem4 = MenuItem("204F     ");
      MenuItem menuItem3SubItem5 = MenuItem("205F     ");
      MenuItem menuItem3SubItem6 = MenuItem("206F     ");
   MenuItem menu1Item4 = MenuItem("Clean"); 
      MenuItem menuItem4SubItem1 = MenuItem("Begin Clean"); 
      
void setup()
{
  pinMode(DIR_PIN, OUTPUT);
  pinMode(STEP_PIN, OUTPUT);
  pinMode(SLEEP_PIN, OUTPUT);
  pinMode(buttonPinLeft, INPUT);
  pinMode(buttonPinRight, INPUT);
  pinMode(buttonPinEnter, INPUT);
  pinMode(buttonPinEsc, INPUT);
  
  lcd.begin(16, 2);

  //configure menu
  menu.getRoot().addRight(menu1Item1).addRight(menu1Item2).addRight(menu1Item3);
  menu1Item1.add(menuItem1SubItem1).addRight(menuItem1SubItem2).addRight(menuItem1SubItem3).addRight(menuItem1SubItem4);
  menu1Item2.add(menuItem2SubItem1).addRight(menuItem2SubItem2).addRight(menuItem2SubItem3).addRight(menuItem2SubItem4).addRight(menuItem2SubItem5).addRight(menuItem2SubItem6).addRight(menuItem2SubItem7).addRight(menuItem2SubItem8).addRight(menuItem2SubItem9).addRight(menuItem2SubItem10).addRight(menuItem2SubItem11);
  menu1Item3.add(menuItem3SubItem1).addRight(menuItem3SubItem2).addRight(menuItem3SubItem3).addRight(menuItem3SubItem4).addRight(menuItem3SubItem5).addRight(menuItem3SubItem6);
  menu.toRoot();
  lcd.setCursor(0,0);  
  //lcd.print("Clover Mod");

}  // setup()...


void loop()
{
  //rotate a specific number of microsteps (8 microsteps per step)
  //This 200 step stepper will take 1600 micro steps for one full revolution
  //speed is any number from .01 -> 1 with 1 being fastest - 
  //Slower Speed == Stronger movement
  //rotateDeg(360, 1);
  //delay(1000);
  
rotate(1600, .5);
delay(1000); //SET DELAY AS BREW TIME

  //rotate(-1600, .25); //reverse
  //delay(1000); 


  readButtons();  //I split button reading and navigation in two procedures because 
  navigateMenus();  //in some situations I want to use the button for other purpose (eg. to change some settings)
                  
} //loop()... 


void menuChanged(MenuChangeEvent changed){
  
  MenuItem newMenuItem=changed.to; //get the destination menu
  
  lcd.setCursor(0,0); //set the start position for lcd printing to the first row
  
  if(newMenuItem.getName()==menu.getRoot()){
      lcd.print("Drink Parameters");
  }else if(newMenuItem.getName()=="Drink Size"){
      lcd.print("Drink Size           ");
  }else if(newMenuItem.getName()=="16 oz Iced"){
      lcd.print("16 oz Iced");
  }else if(newMenuItem.getName()=="12 oz Hot"){
      lcd.print("12 oz Hot   ");
  }else if(newMenuItem.getName()=="16 oz Hot"){
      lcd.print("16 oz Hot   ");  
  }else if(newMenuItem.getName()=="Rinse     "){
      lcd.print("Rinse    ");     
  }else if(newMenuItem.getName()=="Brew Time"){
      lcd.print("Brew Time           ");
  }else if(newMenuItem.getName()=="40 sec     "){
      lcd.print("40 sec                ");
  }else if(newMenuItem.getName()=="41 sec     "){
      lcd.print("41 sec                ");
  }else if(newMenuItem.getName()=="42 sec     "){
      lcd.print("42 sec                ");  
  }else if(newMenuItem.getName()=="43 sec     "){
      lcd.print("43 sec                ");    
  }else if(newMenuItem.getName()=="44 sec     "){
      lcd.print("44 sec                ");
  }else if(newMenuItem.getName()=="45 sec     "){
      lcd.print("45 sec                ");
  }else if(newMenuItem.getName()=="46 sec     "){
      lcd.print("46 sec                "); 
  }else if(newMenuItem.getName()=="47 sec     "){
      lcd.print("47 sec                "); 
  }else if(newMenuItem.getName()=="48 sec     "){
      lcd.print("48 sec                "); 
   }else if(newMenuItem.getName()=="49 sec     "){
      lcd.print("49 sec                "); 
    }else if(newMenuItem.getName()=="50 sec     "){
      lcd.print("50 sec                ");  
  }else if(newMenuItem.getName()=="Temp"){
      lcd.print("Brew Temp           ");
  }else if(newMenuItem.getName()=="201F     "){
      lcd.print("201F           ");
  }else if(newMenuItem.getName()=="202F     "){
      lcd.print("202F           ");
  }else if(newMenuItem.getName()=="203F     "){
      lcd.print("203F           "); 
  }else if(newMenuItem.getName()=="204F     "){
      lcd.print("204F           "); 
  }else if(newMenuItem.getName()=="205F     "){
      lcd.print("205F           ");
  }else if(newMenuItem.getName()=="206F     "){
      lcd.print("206F           ");      
  }
}

void menuUsed(MenuUseEvent used){
  lcd.setCursor(0,0);  
  lcd.print("You selected        ");
  lcd.setCursor(0,1); 
  lcd.print(used.item.getName());
  delay(1500);  //delay to allow message reading
  lcd.setCursor(0,0);  
  //lcd.print("Clover Mod    ");
  menu.toRoot();  //back to Main
}

And here is the rest.....

void  readButtons(){  //read buttons status
  int reading;
  int buttonEnterState=LOW;             // the current reading from the Enter input pin
  int buttonEscState=LOW;             // the current reading from the input pin
  int buttonLeftState=LOW;             // the current reading from the input pin
  int buttonRightState=LOW;             // the current reading from the input pin

  //Enter button
                  // read the state of the switch into a local variable:
                  reading = digitalRead(buttonPinEnter);

                  // check to see if you just pressed the enter button 
                  // (i.e. the input went from LOW to HIGH),  and you've waited 
                  // long enough since the last press to ignore any noise:  
                
                  // If the switch changed, due to noise or pressing:
                  if (reading != lastButtonEnterState) {
                    // reset the debouncing timer
                    lastEnterDebounceTime = millis();
                  } 
                  
                  if ((millis() - lastEnterDebounceTime) > debounceDelay) {
                    // whatever the reading is at, it's been there for longer
                    // than the debounce delay, so take it as the actual current state:
                    buttonEnterState=reading;
                    lastEnterDebounceTime=millis();
                  }
                  
                  // save the reading.  Next time through the loop,
                  // it'll be the lastButtonState:
                  lastButtonEnterState = reading;
                  

    //Esc button               
                  // read the state of the switch into a local variable:
                  reading = digitalRead(buttonPinEsc);

                  // check to see if you just pressed the Down button 
                  // (i.e. the input went from LOW to HIGH),  and you've waited 
                  // long enough since the last press to ignore any noise:  
                
                  // If the switch changed, due to noise or pressing:
                  if (reading != lastButtonEscState) {
                    // reset the debouncing timer
                    lastEscDebounceTime = millis();
                  } 
                  
                  if ((millis() - lastEscDebounceTime) > debounceDelay) {
                    // whatever the reading is at, it's been there for longer
                    // than the debounce delay, so take it as the actual current state:
                    buttonEscState = reading;
                    lastEscDebounceTime=millis();
                  }
                  
                  // save the reading.  Next time through the loop,
                  // it'll be the lastButtonState:
                  lastButtonEscState = reading; 
                  
                     
   //Down button               
                  // read the state of the switch into a local variable:
                  reading = digitalRead(buttonPinRight);

                  // check to see if you just pressed the Down button 
                  // (i.e. the input went from LOW to HIGH),  and you've waited 
                  // long enough since the last press to ignore any noise:  
                
                  // If the switch changed, due to noise or pressing:
                  if (reading != lastButtonRightState) {
                    // reset the debouncing timer
                    lastRightDebounceTime = millis();
                  } 
                  
                  if ((millis() - lastRightDebounceTime) > debounceDelay) {
                    // whatever the reading is at, it's been there for longer
                    // than the debounce delay, so take it as the actual current state:
                    buttonRightState = reading;
                   lastRightDebounceTime =millis();
                  }
                  
                  // save the reading.  Next time through the loop,
                  // it'll be the lastButtonState:
                  lastButtonRightState = reading;                  
                  
                  
    //Up button               
                  // read the state of the switch into a local variable:
                  reading = digitalRead(buttonPinLeft);

                  // check to see if you just pressed the Down button 
                  // (i.e. the input went from LOW to HIGH),  and you've waited 
                  // long enough since the last press to ignore any noise:  
                
                  // If the switch changed, due to noise or pressing:
                  if (reading != lastButtonLeftState) {
                    // reset the debouncing timer
                    lastLeftDebounceTime = millis();
                  } 
                  
                  if ((millis() - lastLeftDebounceTime) > debounceDelay) {
                    // whatever the reading is at, it's been there for longer
                    // than the debounce delay, so take it as the actual current state:
                    buttonLeftState = reading;
                    lastLeftDebounceTime=millis();;
                  }
                  
                  // save the reading.  Next time through the loop,
                  // it'll be the lastButtonState:
                  lastButtonLeftState = reading;  

                  //records which button has been pressed
                  if (buttonEnterState==HIGH){
                    lastButtonPushed=buttonPinEnter;

                  }else if(buttonEscState==HIGH){
                    lastButtonPushed=buttonPinEsc;

                  }else if(buttonRightState==HIGH){
                    lastButtonPushed=buttonPinRight;

                  }else if(buttonLeftState==HIGH){
                    lastButtonPushed=buttonPinLeft;

                  }else{
                    lastButtonPushed=0;
                  }                  
}

void navigateMenus() {
  MenuItem currentMenu=menu.getCurrent();
  
  switch (lastButtonPushed){
    case buttonPinEnter:
      if(!(currentMenu.moveDown())){  //if the current menu has a child and has been pressed enter then menu navigate to item below
        menu.use();
      }else{  //otherwise, if menu has no child and has been pressed enter the current menu is used
        menu.moveDown();
       } 
      break;
    case buttonPinEsc:
      menu.toRoot();  //back to main
      break;
    case buttonPinRight:
      menu.moveRight();
      break;      
    case buttonPinLeft:
      menu.moveLeft();
      break;      
  }
  
  lastButtonPushed=0; //reset the lastButtonPushed variable
}

Is rotate() a part of stepper.h? Looking at the stepper example in the IDE, maybe you need something like this

Stepper myStepper(stepsPerRevolution, 8,9,10,11); //fill in the appropriate values for your setup 
myStepper.rotate(1600, .5);

Edit Did your code example come from here: http://bildr.org/2011/06/easydriver/ ? If so you simply need to copy their rotate() function into your sketch.

It did indeed come from there Tedcook!

I have now copied the rotate function, however when I compile I am getting another error. This one says -
a function definition is not allowed here before “{” token.

I have noticed that the code I wrote to check if the “Go button” goes HIGH, seems to be causing it, but I dont know why. Here is the code in 2 posts

#include <MenuBackend.h>    //MenuBackend library - copyright by Alexander Brevig
#include <LiquidCrystal.h>  //this library is included in the Arduino IDE
#include <Stepper.h>

int DIR_PIN=12; //stepper motor direction pin
int STEP_PIN=13; //stepper motor step pin
//int SLEEP_PIN=7;//stepper motor sleep pin

int Drink_Size; //variable for amount of step by motor to accomodate different drink sizes
int Brew_Delay; // variable for brew time delay


const int buttonPinLeft = 8;      // pin for the Up button
const int buttonPinRight = 9;    // pin for the Down button
const int buttonPinEsc = 10;     // pin for the Esc button
const int buttonPinEnter = 11;   // pin for the Enter button
const int buttonPinGo = 1; //pin number for button that activates the stepper sequence

int lastButtonPushed = 0;

int lastButtonEnterState = LOW;   // the previous reading from the Enter input pin
int lastButtonEscState = LOW;   // the previous reading from the Esc input pin
int lastButtonLeftState = LOW;   // the previous reading from the Left input pin
int lastButtonRightState = LOW;   // the previous reading from the Right input pin
int lastButtonGoState = LOW;      // the previous reading from the Go input pin

long lastEnterDebounceTime = 0;  // the last time the output pin was toggled
long lastEscDebounceTime = 0;  // the last time the output pin was toggled
long lastLeftDebounceTime = 0;  // the last time the output pin was toggled
long lastRightDebounceTime = 0;  // the last time the output pin was toggled
long lastGoDebounceTime = 0;      // the last time the output pin was toggled
long debounceDelay = 250;    // the debounce time

// LiquidCrystal display with:
// rs on pin 7
// rw on ground
// enable on pin 6
// d4, d5, d6, d7 on pins 5, 4, 3, 2
LiquidCrystal lcd(2, 3, 4, 5, 6, 7);

//Menu variables
MenuBackend menu = MenuBackend(menuUsed,menuChanged);
//initialize menuitems
    MenuItem menu1Item1 = MenuItem("Drink Size");
      MenuItem menuItem1SubItem1 = MenuItem("16 oz Iced");
      MenuItem menuItem1SubItem2 = MenuItem("12 oz Hot");
      MenuItem menuItem1SubItem3 = MenuItem("16 oz Hot");
      MenuItem menuItem1SubItem4 = MenuItem("Rinse     ");
      MenuItem menu1Item2 = MenuItem("Brew Time");
      MenuItem menuItem2SubItem1 = MenuItem("40 sec     ");
      MenuItem menuItem2SubItem2 = MenuItem("41 sec     ");
      MenuItem menuItem2SubItem3 = MenuItem("42 sec     ");
      MenuItem menuItem2SubItem4 = MenuItem("43 sec     ");
      MenuItem menuItem2SubItem5 = MenuItem("44 sec     ");
      MenuItem menuItem2SubItem6 = MenuItem("45 sec     ");
      MenuItem menuItem2SubItem7 = MenuItem("46 sec     ");
      MenuItem menuItem2SubItem8 = MenuItem("47 sec     ");
      MenuItem menuItem2SubItem9 = MenuItem("48 sec     ");
      MenuItem menuItem2SubItem10 = MenuItem("49 sec     ");
      MenuItem menuItem2SubItem11 = MenuItem("50 sec     ");
      MenuItem menu1Item3 = MenuItem("Temp");
      MenuItem menuItem3SubItem1 = MenuItem("201F     ");
      MenuItem menuItem3SubItem2 = MenuItem("202F     ");
      MenuItem menuItem3SubItem3 = MenuItem("203F     ");
      MenuItem menuItem3SubItem4 = MenuItem("204F     ");
      MenuItem menuItem3SubItem5 = MenuItem("205F     ");
      MenuItem menuItem3SubItem6 = MenuItem("206F     ");
   MenuItem menu1Item4 = MenuItem("Clean"); 
      MenuItem menuItem4SubItem1 = MenuItem("Begin Clean"); 
      
void setup()
{
  pinMode(DIR_PIN, OUTPUT);
  pinMode(STEP_PIN, OUTPUT);
  //pinMode(SLEEP_PIN, OUTPUT);
  pinMode(buttonPinLeft, INPUT);
  pinMode(buttonPinRight, INPUT);
  pinMode(buttonPinEnter, INPUT);
  pinMode(buttonPinEsc, INPUT);
  pinMode(buttonPinGo, INPUT);
  
  
  lcd.begin(16, 2);

  //configure menu
  menu.getRoot().addRight(menu1Item1).addRight(menu1Item2).addRight(menu1Item3);
  menu1Item1.add(menuItem1SubItem1).addRight(menuItem1SubItem2).addRight(menuItem1SubItem3).addRight(menuItem1SubItem4);
  menu1Item2.add(menuItem2SubItem1).addRight(menuItem2SubItem2).addRight(menuItem2SubItem3).addRight(menuItem2SubItem4).addRight(menuItem2SubItem5).addRight(menuItem2SubItem6).addRight(menuItem2SubItem7).addRight(menuItem2SubItem8).addRight(menuItem2SubItem9).addRight(menuItem2SubItem10).addRight(menuItem2SubItem11);
  menu1Item3.add(menuItem3SubItem1).addRight(menuItem3SubItem2).addRight(menuItem3SubItem3).addRight(menuItem3SubItem4).addRight(menuItem3SubItem5).addRight(menuItem3SubItem6);
  menu.toRoot();
  lcd.setCursor(0,0);  
  //lcd.print("Clover Mod");

}  // setup()...




void loop()
{
  //rotate a specific number of microsteps (8 microsteps per step)
  //This 200 step stepper will take 1600 micro steps for one full revolution
  //speed is any number from .01 -> 1 with 1 being fastest - 
  //Slower Speed == Stronger movement
  //rotateDeg(360, 1);
  //delay(1000);
  
  readButtons();  //I split button reading and navigation in two procedures because 
  navigateMenus();  //in some situations I want to use the button for other purpose (eg. to change some settings)
  
 if (buttonPinGo==HIGH) {rotate(Drink_Size, .5); //rotate to value of Drink_Size variable
 delay(Brew_Delay); //delay for value of Brew-Delay variable

  //rotate(-Drink_Size, .5); //reverse
 // delay(1000); 
                  
} //loop()... 




void menuChanged(MenuChangeEvent changed){
  
  MenuItem newMenuItem=changed.to; //get the destination menu
  
  lcd.setCursor(0,0); //set the start position for lcd printing to the first row
  
  if(newMenuItem.getName()==menu.getRoot()){
      lcd.print("Drink Parameters");
  }else if(newMenuItem.getName()=="Drink Size"){
      lcd.print("Drink Size           ");
  }else if(newMenuItem.getName()=="16 oz Iced"){
      lcd.print("16 oz Iced");
      Drink_Size=1600;
  }else if(newMenuItem.getName()=="12 oz Hot"){
      lcd.print("12 oz Hot   ");
            Drink_Size=3200;
  }else if(newMenuItem.getName()=="16 oz Hot"){
      lcd.print("16 oz Hot   "); 
           Drink_Size=4000; 
  }else if(newMenuItem.getName()=="Rinse     "){
      lcd.print("Rinse    ");   
      Drink_Size=4000;   
  }else if(newMenuItem.getName()=="Brew Time"){
      lcd.print("Brew Time           ");
  }else if(newMenuItem.getName()=="40 sec     "){
      lcd.print("40 sec                ");
      Brew_Delay = 40000;
  }else if(newMenuItem.getName()=="41 sec     "){
      lcd.print("41 sec                ");
  }else if(newMenuItem.getName()=="42 sec     "){
      lcd.print("42 sec                ");  
  }else if(newMenuItem.getName()=="43 sec     "){
      lcd.print("43 sec                ");    
  }else if(newMenuItem.getName()=="44 sec     "){
      lcd.print("44 sec                ");
  }else if(newMenuItem.getName()=="45 sec     "){
      lcd.print("45 sec                ");
  }else if(newMenuItem.getName()=="46 sec     "){
      lcd.print("46 sec                "); 
  }else if(newMenuItem.getName()=="47 sec     "){
      lcd.print("47 sec                "); 
  }else if(newMenuItem.getName()=="48 sec     "){
      lcd.print("48 sec                "); 
   }else if(newMenuItem.getName()=="49 sec     "){
      lcd.print("49 sec                "); 
    }else if(newMenuItem.getName()=="50 sec     "){
      lcd.print("50 sec                ");  
  }else if(newMenuItem.getName()=="Temp"){
      lcd.print("Brew Temp           ");
  }else if(newMenuItem.getName()=="201F     "){
      lcd.print("201F           ");
  }else if(newMenuItem.getName()=="202F     "){
      lcd.print("202F           ");
  }else if(newMenuItem.getName()=="203F     "){
      lcd.print("203F           "); 
  }else if(newMenuItem.getName()=="204F     "){
      lcd.print("204F           "); 
  }else if(newMenuItem.getName()=="205F     "){
      lcd.print("205F           ");
  }else if(newMenuItem.getName()=="206F     "){
      lcd.print("206F           ");      
  }
}

void menuUsed(MenuUseEvent used){
  lcd.setCursor(0,0);  
  lcd.print("You selected        ");
  lcd.setCursor(0,1); 
  lcd.print(used.item.getName());
  delay(1500);  //delay to allow message reading
  lcd.setCursor(0,0);  
  //lcd.print("Clover Mod    ");
  menu.toRoot();  //back to Main
}

And here is the rest…

void  readButtons(){  //read buttons status
  int reading;
  int buttonEnterState=LOW;             // the current reading from the Enter input pin
  int buttonEscState=LOW;             // the current reading from the input pin
  int buttonLeftState=LOW;             // the current reading from the input pin
  int buttonRightState=LOW;             // the current reading from the input pin
  int buttonGoState=LOW;                //current reading from Go input pin

  //Enter button
                  // read the state of the switch into a local variable:
                  reading = digitalRead(buttonPinEnter);

                  // check to see if you just pressed the enter button 
                  // (i.e. the input went from LOW to HIGH),  and you've waited 
                  // long enough since the last press to ignore any noise:  
                
                  // If the switch changed, due to noise or pressing:
                  if (reading != lastButtonEnterState) {
                    // reset the debouncing timer
                    lastEnterDebounceTime = millis();
                  } 
                  
                  if ((millis() - lastEnterDebounceTime) > debounceDelay) {
                    // whatever the reading is at, it's been there for longer
                    // than the debounce delay, so take it as the actual current state:
                    buttonEnterState=reading;
                    lastEnterDebounceTime=millis();
                  }
                  
                  // save the reading.  Next time through the loop,
                  // it'll be the lastButtonState:
                  lastButtonEnterState = reading;
                  

    //Esc button               
                  // read the state of the switch into a local variable:
                  reading = digitalRead(buttonPinEsc);

                  // check to see if you just pressed the Down button 
                  // (i.e. the input went from LOW to HIGH),  and you've waited 
                  // long enough since the last press to ignore any noise:  
                
                  // If the switch changed, due to noise or pressing:
                  if (reading != lastButtonEscState) {
                    // reset the debouncing timer
                    lastEscDebounceTime = millis();
                  } 
                  
                  if ((millis() - lastEscDebounceTime) > debounceDelay) {
                    // whatever the reading is at, it's been there for longer
                    // than the debounce delay, so take it as the actual current state:
                    buttonEscState = reading;
                    lastEscDebounceTime=millis();
                  }
                  
                  // save the reading.  Next time through the loop,
                  // it'll be the lastButtonState:
                  lastButtonEscState = reading; 
                  
                     
   //Down button               
                  // read the state of the switch into a local variable:
                  reading = digitalRead(buttonPinRight);

                  // check to see if you just pressed the Down button 
                  // (i.e. the input went from LOW to HIGH),  and you've waited 
                  // long enough since the last press to ignore any noise:  
                
                  // If the switch changed, due to noise or pressing:
                  if (reading != lastButtonRightState) {
                    // reset the debouncing timer
                    lastRightDebounceTime = millis();
                  } 
                  
                  if ((millis() - lastRightDebounceTime) > debounceDelay) {
                    // whatever the reading is at, it's been there for longer
                    // than the debounce delay, so take it as the actual current state:
                    buttonRightState = reading;
                   lastRightDebounceTime =millis();
                  }
                  
                  // save the reading.  Next time through the loop,
                  // it'll be the lastButtonState:
                  lastButtonRightState = reading;                  
                  
                  
    //Up button               
                  // read the state of the switch into a local variable:
                  reading = digitalRead(buttonPinLeft);

                  // check to see if you just pressed the Down button 
                  // (i.e. the input went from LOW to HIGH),  and you've waited 
                  // long enough since the last press to ignore any noise:  
                
                  // If the switch changed, due to noise or pressing:
                  if (reading != lastButtonLeftState) {
                    // reset the debouncing timer
                    lastLeftDebounceTime = millis();
                  } 
                  
                  if ((millis() - lastLeftDebounceTime) > debounceDelay) {
                    // whatever the reading is at, it's been there for longer
                    // than the debounce delay, so take it as the actual current state:
                    buttonLeftState = reading;
                    lastLeftDebounceTime=millis();;
                  }
                  
                  // save the reading.  Next time through the loop,
                  // it'll be the lastButtonState:
                  lastButtonLeftState = reading;  

                  //records which button has been pressed
                  if (buttonEnterState==HIGH){
                    lastButtonPushed=buttonPinEnter;

                  }else if(buttonEscState==HIGH){
                    lastButtonPushed=buttonPinEsc;

                  }else if(buttonRightState==HIGH){
                    lastButtonPushed=buttonPinRight;

                  }else if(buttonLeftState==HIGH){
                    lastButtonPushed=buttonPinLeft;

                  }else{
                    lastButtonPushed=0;
                  }                  
}

void navigateMenus() {
  MenuItem currentMenu=menu.getCurrent();
  
  switch (lastButtonPushed){
    case buttonPinEnter:
      if(!(currentMenu.moveDown())){  //if the current menu has a child and has been pressed enter then menu navigate to item below
        menu.use();
      }else{  //otherwise, if menu has no child and has been pressed enter the current menu is used
        menu.moveDown();
       } 
      break;
    case buttonPinEsc:
      menu.toRoot();  //back to main
      break;
    case buttonPinRight:
      menu.moveRight();
      break;      
    case buttonPinLeft:
      menu.moveLeft();
      break;      
  }
  
  lastButtonPushed=0; //reset the lastButtonPushed variable
}
void rotate(int steps, float speed){
  //rotate a specific number of microsteps (8 microsteps per step) - (negitive for reverse movement)
  //speed is any number from .01 -> 1 with 1 being fastest - Slower is stronger
  int dir = (steps > 0)? HIGH:LOW;
  steps = abs(steps);

  digitalWrite(DIR_PIN,dir); 

  float usDelay = (1/speed) * 70;

  for(int i=0; i < steps; i++){
    digitalWrite(STEP_PIN, HIGH);
    delayMicroseconds(usDelay); 

    digitalWrite(STEP_PIN, LOW);
    delayMicroseconds(usDelay);
  }
}

Nevermind, I figured it out. Still new to Arduino, so I think I was overcomplicating things. A simple digitalRead did the trick!