OK, this time I got it. I moved the entire colorstate switch out of the first loop and then added "ledstate == LED2" to the first line as was mentioned before. Thanks for the help again PaulS! 8-)
Here is the code as it works for me.
// include the library code:
#include <LiquidCrystal.h>
#include <Button.h>
// initialize the 4 bit LCD library with the numbers of the interface pins
LiquidCrystal lcd(2, 3, 4, 5, 6, 7);
//first define states with obvious names and different values
#define LED1 0
#define LED2 1
#define LED3 2
#define COLOR1 3
#define COLOR2 4
#define COLOR3 5
//next define which pin is which
#define RED_PIN 9
#define BLUE_PIN 10
int buttonState = 0;
int buttonState2 = 0;
int switchPin = 11; // switch is connected to pin 11
int switchPin2 = 12; // switch is connected to pin 12
int ledstate = LED1; //create state variable and initialize it to START state
int colorState = COLOR1; //create state variable and initialize it to START state
int previousButtonOneState;
int previousButtonTwoState;
int buttonOneState;
int buttonTwoState;
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
void setup() {
//LCD SETUP
// set up the LCD's number of rows and columns:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print("**MIDI NIGHTS**");
delay (1000);
lcd.setCursor(0, 4);
lcd.print("LED Menu Options");
delay (1000);
lcd.clear();
// resets cursor position
lcd.setCursor(0, 4);
lcd.print(" Use right/left buttons to select LED ");
delay (20);
// scroll 27 positions (string length) to the left
// to move it offscreen left:
for (int positionCounter = 0; positionCounter < 27; positionCounter++) {
// scroll one position left:
lcd.scrollDisplayLeft();
// wait a bit:
delay(50);
}
{
delay (300);
lcd.clear(); //clear LCD and reset cursor
lcd.setCursor(1, 9);
lcd.print("Select LED < >"); //Select desired LED from menu
delay(2000);
}
pinMode(RED_PIN, OUTPUT); // Set the pin as output
pinMode(BLUE_PIN, OUTPUT); // Set the pin as output
pinMode(switchPin, INPUT); // Set the switch pin as input
pinMode(switchPin2, INPUT); // Set the switch pin as input
digitalWrite(BLUE_PIN,LOW); //turn blue led off
digitalWrite(RED_PIN,LOW); //turn red led off
Serial.begin(9600); // Set up serial communication at 9600bps
previousButtonOneState = LOW;
previousButtonTwoState = LOW;
buttonOneState = LOW;
buttonTwoState = LOW;
}
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
void loop(){
buttonOneState = digitalRead(switchPin);
buttonTwoState = digitalRead(switchPin2);
if(buttonOneState == HIGH && previousButtonOneState == LOW){
switch(ledstate){
case LED1:
lcd.clear();
lcd.print("Snare");
digitalWrite(BLUE_PIN,HIGH); //turn blue led off
digitalWrite(RED_PIN,HIGH); //turn red led off
delay(100); //wait 100ms
ledstate = LED2; //transition to led2 state
break; //end of led1 case
case LED2:
lcd.clear();
lcd.print("TOM 1");
digitalWrite(BLUE_PIN,LOW); //turn blue led off
digitalWrite(RED_PIN,HIGH); //turn red led on
delay(200); //wait 200ms
ledstate = LED3; //transition to led3 state
break; //end of led2 case
case LED3:
lcd.clear();
lcd.print("TOM 2");
digitalWrite(RED_PIN,LOW); //turn red led off
digitalWrite(BLUE_PIN,HIGH); //turn blue led on
delay(200); //wait 200ms
ledstate = LED1; //transition to led1 state
break; //end of led3 case
}
}
if(buttonTwoState == HIGH && previousButtonTwoState == LOW && ledstate == LED2){
switch(colorState){
case COLOR1:
lcd.clear();
lcd.print("Color 1");
colorState = COLOR2; //transition to color2 state
break; //end of color1 case
case COLOR2:
lcd.clear();
lcd.print("Color 2");
colorState = COLOR3; //transition to color3 state
break; //end of color2 case
case COLOR3:
lcd.clear();
lcd.print("Color 3");
colorState = COLOR1; //transition back to color1 state
break; //end of color3 case
previousButtonTwoState = buttonTwoState;
}
}
previousButtonOneState = buttonOneState;
previousButtonTwoState = buttonTwoState;
}