Hii comm,
I am 17 years old and I am making a school project for my exam. And using this posting thing for the first time. Right now I am trying to make a little book search machine. When you press a button on the keypad it will show on the lcd display but I am stuck at this moment.
I am trying to get the numbers, I pressed on the keypad, in the second row of my lcd screen. But right now the previous number I pressed will be replaced for the next number that is pressed.
Second problem, I want to send the numbers I pressed to a Python script. Is that possible?
Can someone please help me?
Here is my code:
#include <LiquidCrystal.h>
#include <Keypad.h>
const byte numRows= 4;
const byte numCols= 3;
LiquidCrystal lcd(8, 9, 7, 6, 5, 4);
char keymap[numRows][numCols]=
{
{'1','2','3'},
{'4','5','6'},
{'7','8','9'},
{'*','0','#'}
};
byte rowPins[numRows]= {13, 12, 11, 10};
byte colPins[numCols]= {3, 2, A1};
Keypad myKeypad= Keypad(makeKeymap(keymap), rowPins, colPins, numRows, numCols);
char key,action;
int count=0;
void setup(){
lcd.begin(16, 2);
lcd.print("BOEKNUMMER:");
Serial.begin(9600);
}
void loop() {
char key = myKeypad.getKey();
if (key != NO_KEY)
{
lcd.setCursor(0, 2);
lcd.print(key);
Serial.print(key);
count++;
}
}