iam beginer and i have some poor problem maybe
my keypad 4x4
and LCD 16x2
void c(){
char key = myKeypad.getKey();
if (key){
if ( key == 48 )key=0; // conversi variable '0' ke 0
lcd.clear();
dtKey = dtKey*10+key;
lcd.print(dtKey);if(key == 'C' ){ // clear data = tekan c;
lcd.clear();
dtKey=0; key = 0;
lcd.print(dtKey);
}
if(key == '#' ){
ppmLimit=dtKey;
lcd.clear();
lcd.print("Data Telah Masuk");
}
if(key == 'D' ){
lcd.clear();
dtKey=0; key=0;
lcd.begin(16, 2);
lcd.setCursor(1, 0);
lcd.print("SetPpmLimit :");
}
if(key == 'A' ){
lcd.clear();
lcd.print("NoCode");
}
if(key == 'B' ){
lcd.print("NoCode");
}
if(key == '*' ){
lcd.setCursor(0, 0); //baris pertama
lcd.print("ppmLimit :");lcd.print(ppmLimit);
if(ECcurrent<=150){
lcd.setCursor(0, 1); //baris kedua
lcd.print("CurrentPpm :");lcd.print("Idle");
}
else{
lcd.setCursor(0, 1); //baris kedua
lcd.print("CurrentPpm :");lcd.print(ECcurrent,0);
}
}
}}
i got code like that, ,if i run the code it run well but 1 problem is if i press 111 and want store it it will be 1145, the last number of 1 is change by 45,,,,so i decided to test all number from 0-9 and the result is all my number have another value than it self . The value for each number is
0 = 35
1 = 45
2 = 55
3 = 65
4 = 75
5 = 85
6 = 95
7 = 105
8 = 115
9 = 125
how to fix this ??
so if i press 111 it still 111 not 1145
thx for helping~