#include <Wire.h>
#include <LiquidCrystal.h>
#include <Key.h>
#include <Keypad.h>
LiquidCrystal_I2C lcd(0x3f, 16, 2);
char keys [4][4]={
{'1','2','3','A'},
{'4','5','6','B'},
{'7','8','9','C'},
};
byte rowPins[4]={2,3,4,5};
byte colPins[4]={6,7,8,9};
Keypad myKeypad = Keypad(makeKeymap(keys), rowPins, colPins,4,4);
void setup(){
int pot = analogRead(A1);
int joys = analogRead(A2);
int ldr = analogRead(A0);
char keyPressed = myKeypad.getkey();
char val;
if(val=='A'){
lcd.clear();
lcd.setCursor(0,0);
lcd.print("POT: ");
lcd.setCursor(6,0);
lcd.print(pot);
}
if(val=='B'){
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Y oxu: ");
lcd.setCursor(8,0);
lcd.print(joys);
}
if(val=='C'){
lcd.clear();
lcd.setCursor(0,0);
lcd.print("ISIQ: ");
lcd.setCursor(7,0);
lcd.print(ldr);
lcd.setCursor(10,0);
lcd.print("%");
}
delay(100);
}