Have keypad and LCD working, how do I use buttons to do things now?

I have worked out how to make my keypad display numbers on my LCD. :smiley:

Now, how do I use my keypad to make things happen like turn relays on, LEDs on off, pwm etc.

If someone could run me through how to do this next step/or show me a website with examples that would be great.

So I want to program the Arduino to take a key press and use that number value to then flash the on board LED that may times.

If I could write it so that when the Arduino starts up, the LCD shows

"Enter number of flashes"
user then enters value

"Enter delay between flashes"
user then enters value

"Enter on time of LED"
user then enters value

"Ready"
user presses the # key, as the "go" or "enter" button.

How would I do all of that?

I have worked out how to make my keypad display numbers on my LCD.

So, you can read from the keypad and presumably put the value read into a variable and display it on the LCD.

Once the value is in the variable you can test it with this type of construct

if (theVariableFromTheKeypad == someValue)
{
  //do something
}

There are traps along the way, such as matching variable types in the test and dealing with multiple character input but the principle is simple.

can you provide me code to "display on lcd through keypad"

Ukhelibob, what is the variable from the keypad called? Getkey or just key? I will have to paste some of my code in later.

what is the variable from the keypad called? Getkey or just key?

You can call it anything you like. Getkey sounds like the name of a function to me.

I have worked out how to make my keypad display numbers on my LCD

Post the code that does that and we will all be wiser.

#include <Keypad.h>
#include <LiquidCrystal_I2C.h>
#include <Wire.h>  
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);


const byte ROWS = 4; //four rows
const byte COLS = 3; //three columns
char keys[ROWS][COLS] = {
  {'1','2','3'},
  {'4','5','6'},
  {'7','8','9'},
  {'*','0','#'}
};
byte rowPins[ROWS] = {9, 8, 7, 6}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {12, 11, 10}; //connect to the column pinouts of the keypad

Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );

void setup(){
  Serial.begin(9600);
  lcd.begin(20,4);
  lcd.setCursor(1,1);
  lcd.print("Ready for numbers!");
  delay(3000);
  lcd.clear();
}
  
void loop(){
  char key = keypad.getKey();
  
  if (key){
    
    Serial.println(key);
    lcd.print(key);
    }
    
  if (key == '#'){
    lcd.clear();
    }
  
}

I have just realised that you are the same person in another post that told me to go back and look at post number 3. I will go back to that thread....

char key = keypad.getKey();

Now we can see that the variable containing the ASCII code for the number entered is key. That is the one that you need to manipulate to create the actual number as described in reply #3 of the other thread.