Change 16x2 display with button

Hello folks,
Brand spanking new to arduino, and coding of any kind.

I've had decent luck so far, combining two sketches, and using a pot. switch in place of other sensors for the time being, while I get familiar with the coding, and set up the way I'd like.

The first sketch used a pot. switch to control 3 LED's. The second sketch showed a pot. switches value as a percentage on the 16x2 display.

For each of the four sensors I'd like to eventually monitor, I played with the text and pot. values a little bit, and saved as a separate sketch.

Basically, I'd like to be able to push a button, and display each one. Seems fairly basic, but I can't seem to find the solution, and feel kinda stalled.

Could anyone help me out?

Thanks

/* YourDuinoStarter Example: Sketch Template
 - WHAT IT DOES
 - SEE the comments after "//" on each line below
 - CONNECTIONS:
   - 
   - 
 - V1.00 09/11/12
   Questions: terry@yourduino.com */

/*-----( Import needed libraries )-----*/
/*-----( Declare Constants and Pin Numbers )-----*/
/*-----( Declare objects )-----*/
/*-----( Declare Variables )-----*/

#include <LiquidCrystal.h> // include the LCD library

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

// INPUT: Potentiometer should be connected to 5V and GND
int potPin = 0; // Potentiometer output connected to analog pin 1
int potVal = 0; // Variable to store the input from the potentiometer
int potValue2 = 0; // final display variable MPH
int potValue3 = 0; // final display variable RPM

// OUTPUT: Use digital pins 9-11, the Pulse-width Modulation (PWM) pins
// LED's cathodes should be connected to digital GND
int redPin = 9;   // Red LED,   connected to digital pin 9
int grnPin = 10;  // Green LED, connected to digital pin 10
int bluPin = 8;  // Blue LED,  connected to digital pin 8

// Program variables
int redVal = 0;   // Variables to store the values to send to the pins
int grnVal = 0;
int bluVal = 0;


void setup()   /****** SETUP: RUNS ONCE ******/
{
    lcd.begin(16, 2); // lcd rows and columns
    lcd.print("    Flywheel"); // title of sorts

  pinMode(redPin, OUTPUT);   // sets the pins as output
  pinMode(grnPin, OUTPUT);
  pinMode(bluPin, OUTPUT);
}//--(end setup )---


void loop()   /****** LOOP: RUNS CONSTANTLY ******/
{
  potVal = analogRead(potPin);   // read the potentiometer value at the input pin

  if (potVal < 510)  // Lowest third of the potentiometer's range (0-340)
  {
    potVal = (potVal * 3) / 4; // Normalize to 0-255

    redVal = 0;  // Red off
    grnVal = 0;        // Green off
    bluVal = 255;   // Blue full to off
  }
  else if (potVal < 920) // Middle third of potentiometer's range (341-681)
  {
    potVal = ( (potVal - 341) * 3) / 4; // Normalize to 0-255

    redVal = 0;            // Red off
    grnVal = 255; // Green from full to off
    bluVal = 0;       // Blue off
  }
  else  // Upper third of potentiometer"s range (682-1023)
  {
    potVal = ( (potVal - 983) * 3) / 4; // Normalize to 0-255

    redVal = 255;       // Red from off to full
    grnVal = 0;            // Green off
    bluVal = 0; // Blue off
    
  }
  analogWrite(redPin, redVal);   // Write values to LED pins
  analogWrite(grnPin, grnVal);
  analogWrite(bluPin, bluVal);
  
// read then divide the input(max 1020 in this case) by 10
    potVal = analogRead(potPin) / 10  ;
// divide by 1.0 to get percentage
    potValue2 = potVal / 1.02;
    potValue3 = potVal * 8;

    // set cursor to second row, first column
    lcd.setCursor(1, 1);
//display RPM
//print RPM:
    lcd.print("RPM:");
    lcd.print(potValue3);
// set cursor to second row, first column
    lcd.setCursor(9, 1);
//display final percentage
//print the MPH:
    lcd.print("MPH:");
    lcd.print(potValue2);
//wait 0.1 seconds
    delay(100);
//wipe the extra characters
    lcd.print(" ");
    delay(1);
}//--(end main loop )---

/*-----( Declare User-written Functions )-----*/


//*********( THE END )***********

Forget the pushbutton and LCD display for now.

Can you display the value from each of the sensors one after the other each on their own line on the Serial monitor ? Once you can do that then choosing which one to display on the LCD by means of a pushbutton will be easier to implement.

Dremmer:
Basically, I'd like to be able to push a button, and display each one.

Not quite sure what you mean.... you mean one button, four sensors, and each subsequent push of the button displays the next sensor 1-2-3-4-1-2-3-4 etc?

If so have a look at the example which counts button presses, then depending on the counter value you could have a switch...case to do different things, ie show a different sensor.

But I may have misunderstood what you're trying to do.

PS I see I'm not the only one who cuts holes in kitchen containers?

UKHeliBob:
Can you display the value from each of the sensors one after the other each on their own line on the Serial monitor ? Once you can do that then choosing which one to display on the LCD by means of a pushbutton will be easier to implement.

After a little tinkering I added a couple more pot. switches to give me three analog inputs, and was able to piece together what I needed to control each at the same time. Two values on the LCD and one controlling the LED's.
The serial monitor showed each was on their own line. Still not quite sure where to go from here, heh.

kenwood120s:
Not quite sure what you mean.... you mean one button, four sensors, and each subsequent push of the button displays the next sensor 1-2-3-4-1-2-3-4 etc?

PS I see I'm not the only one who cuts holes in kitchen containers?

Yep that's what i was hoping to figure out. Ultimately I'd like to be able to set parameters as well, but right now I'd be happy just understanding how to make it display different values using a push button.

And yep I use what I got layin around, haha.

Have a look at the StateChangeDetection example in the IDE.

It shows how to detect when a button has become pressed enabling you to increment a counter which could then be used to determine what to display on the LCD.

UKHeliBob:
Have a look at the StateChangeDetection example in the IDE.

It shows how to detect when a button has become pressed enabling you to increment a counter which could then be used to determine what to display on the LCD.

#2