Hi! I am new to arduino and currently I'm going to make my first project.
My project involves a status menu in where, whenever the user changes the data through the keypad,
my system should also update and display it in lcd.
I'm going to make a charging station in where a user can select a specific brand of their phone and he/she has the option to choose whether it has security or not in addition if the user chooses the one with security, the user can choose the time to charge his phone.
For this project I'm making two lockers (apple and android)
and I decided to use nested Switch but I'm having trouble at the beginning
sooif anyone willing to give me a small push it'll be much appreciated.
Here's my code
#include <Keypad.h>
#include<LiquidCrystal_I2C.h>
#include <EEPROM.h>
#include <Wire.h>
LiquidCrystal_I2C lcd(0x3F,2,1,0,4,5,6,7,3,POSITIVE);
const byte ROWS = 4; //four rows
const byte COLS = 4; //four columns
char customkey;
char customkey2=0;
char customkey3 = 0;
char password[5];
String statusString1="okay"; // STATUS FOR DISPLAY
String statusString2="okay"; // STATUS FOR DISPLAY
int x1 = 0; // STORE OF RANDOM PASSWORD
int x2 = 0; // STORE OF RANDOM PASSWORD 2
int i=0; //Character OF password input in keypad
int j=0;
int led = 13; // LED at PIN 13
int data1 = 0; //
int data2 = 0; //
int code = 0;
int code2 = 1;
int checker1 =0;//
int theint = 0;
char hexaKeys[ROWS][COLS] = {
{'1', '2', '3', 'A'},
{'4', '5', '6', 'B'},
{'7', '8', '9', 'C'},
{'*', '0', '#', 'D'}
};
byte rowPins[ROWS] = {8, 7, 6, 5}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {9, 10, 11, 12}; //connect to the column pinouts of the keypad
//initialize an instance of class NewKeypad
Keypad customKeypad = Keypad( makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS);
//******************************************SETUP******************************
void setup()
{
Serial.begin(9600);
pinMode(led, OUTPUT);
randomSeed(analogRead(A0));
lcd.begin(16,2);
stat();
}
//******************************************LOOP******************************
void loop()
{
customkey = customKeypad.getKey();
while(customkey==NO_KEY)
{customkey=customKeypad.getKey();}
switch(customkey)
{ case '1' :
lcd.clear();
lcd.setCursor(0,0);
lcd.print("A. With PS");
lcd.setCursor(0,1);
lcd.print("B. Without PS");
if (customkey=='1'){
switch(customkey){
case 'A':
lcd.clear();
lcd.setCursor(4,0);
lcd.print("TIME");
lcd.setCursor(0,1);
lcd.print("1.30S");
lcd.setCursor(7,1);
lcd.print("2.60S");
break;}}
break;}
}
void stat() {
lcd.setCursor(0,0);
lcd.print("1.Brand1");
lcd.setCursor (9,0);
lcd.print(statusString1);
lcd.setCursor(0,1);
lcd.print("2.Brand2");
lcd.setCursor (9,1);
lcd.print(statusString2);}