error 'rows' was not declared in scope

I tried to compile but got an error 'rows' was not declared in scope. Tried many other things but still the same error. Hope I can get help from here. Thank you.

sketch_Kpad_SD_LCD.ino (3.77 KB)

rows is not the same as ROWS? I find no occurrence of "rows" in your code.

People do not like to have to download code.
Read the how to use this forum-please read sticky to see how to properly post code and some advice on how to ask a good question.

When you have an error, post the whole text of the error. Paraphrasing the error always leaves out important information. It is easy since there is a copy errors button in the IDE. Copy the error and paste to a post in code tags.

Keypad keypad(KEYPAD_PIN_COL1, KEYPAD_PIN_COL2, KEYPAD_PIN_COL3, KEYPAD_PIN_ROW1, KEYPAD_PIN_ROW2, KEYPAD_PIN_ROW3, KEYPAD_PIN_ROW4);

That does not like any keypad declaration that I have seen. I believe if you look at the examples it shoes an ARRAY of column pins and an ARRAY of row pins and a count for each being passed to the constructor, not a list of pin pin numbers.

I think the mistake you are talking about is here:

char keys[ROWS][COLS] =

You forgot to create those two identifiers (ROWS and COLS) and assign values to them. AGAIN: Look at the Keypad library examples: File->Examples->Keypad->...

johnwasser:

Keypad keypad(KEYPAD_PIN_COL1, KEYPAD_PIN_COL2, KEYPAD_PIN_COL3, KEYPAD_PIN_ROW1, KEYPAD_PIN_ROW2, KEYPAD_PIN_ROW3, KEYPAD_PIN_ROW4);

That does not like any keypad declaration that I have seen. I believe if you look at the examples it shoes an ARRAY of column pins and an ARRAY of row pins and a count for each being passed to the constructor, not a list of pin pin numbers.

I think the mistake you are talking about is here:

char keys[ROWS][COLS] =

You forgot to create those two identifiers (ROWS and COLS) and assign values to them. AGAIN: Look at the Keypad library examples: File->Examples->Keypad->...

Okay thank you I got the picture now

groundFungus:
rows is not the same as ROWS? I find no occurrence of "rows" in your code.

People do not like to have to download code.
Read the how to use this forum-please read sticky to see how to properly post code and some advice on how to ask a good question.

When you have an error, post the whole text of the error. Paraphrasing the error always leaves out important information. It is easy since there is a copy errors button in the IDE. Copy the error and paste to a post in code tags.

Okay sorry, I'll re-read the sticky and keep that in mind. Thank you