#include <LiquidCrystal_I2C.h>
#include <Wire.h>
LiquidCrystal_I2C lcd(0x27, 20, 4); // I2C address 0x27, 20 column and 4 rows
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
lcd.init(); // initialize the lcd
lcd.backlight();
lcd.setCursor(0, 0); // move cursor to (11, 3)
lcd.print("Proto X101"); // print message at (11, 3)
lcd.setCursor(0, 1); // move cursor to (11, 3)
lcd.print("Charging Station"); // print message at (11, 3)
lcd.setCursor(0, 2); // move cursor to (11, 3)
lcd.print("Firmware Version 1.0"); // print message at (11, 3)
lcd.setCursor(0, 3); // move cursor to (11, 3)
lcd.print("August 7, 2023"); // print message at (11, 3)
delay(1000);
lcd.clear();
//attachInterrupt(digitalPinToInterrupt(countcoinbutt),countcoins,RISING);
//coinvalue=add_time_min*60;
}
char reciev_com;//recieved command
char reciev_com_promo;//
char recieve_sys_code;
void update_data(){
}
void loop() {
// put your main code here, to run repeatedly:
String sms__ =String( Serial.read());//read SMS
//sms[0]~sms[1]=command
//sms[2]~sms[12]=promo
//sms[13]~sms[20=system code]
for(int x=0;x<21;x++){
if(x<2){
reciev_com=reciev_com+sms__[x];
}
if(x==2||x<13){
reciev_com_promo=reciev_com_promo+sms__[x];
}
if(x==13||x<22){
recieve_sys_code=recieve_sys_code+sms__[x];
}
if(x=22){
Serial.println("reciev_com="+reciev_com);
Serial.println("recieved_com_promo="+reciev_com_promo);
Serial.println("recieve_sys_code="+recieve_sys_code);
}
}
}