hello
I have the 4x4 keypad using 1 pin as analog output.
I want to use pin 0, 1, 2 and 3 for, Menu, DHT22, BMP085 and LDR. these are the three sensors in my weather station
String keys="123A456B789C*0#D";
int key;
boolean key_lockout=false;
void setup(){
Serial.begin(9600);
}
void loop(){
key=getKeypad();
if(key!=-1)
Serial.println(keys[key]);
delay(10);
}
int getKeypad(){
int ret=-1;
boolean reset_lockout=false;
if(analogRead(A0)==0)
key_lockout=false;
else if(!key_lockout){
delay(20);
ret=15-(log((analogRead(A0)-183.9)/58.24)/0.1623)+0.5;
key_lockout=true;
}
return ret;
}
I have tried using an array but don't know enough about it. what I want is for the 0 button, when pressed displays the three sensors and their button numbers. when either of these buttons are pressed the relevant display comes up. I don't have a back button as the display will show for about 3-4 seconds then revert back to the "Menu" screen.
I think with the "char * " that I used, the letters in the array were each given a value so pressing 1 gave M, 2 gave e, 3-n, 4-u and so on. (this was on serial display as an experiment not the final project)
I don't understand this and I don't have a degree in computer science, if someone could point me in the right direction I would appreciate it.
many thanks
simon