/********************************************************************************
Transistor used for piezo buzzer:
https://media.digikey.com/pdf/Data%20Sheets/ON%20Semiconductor%20PDFs/PN2222.pdf
********************************************************************************/
/*******************************************
Level shifter used for LCD display:
https:www.ti.com/lit/ds/symlink/txs0108e.pdf
********************************************/
/*****************************
Time API
https://www.worldtimeapi.org/
*****************************/
/***********************
Weather API
https://open-meteo.com/
***********************/
#include <Keypad.h>
#include <ArduinoJson.h>
#include <LiquidCrystal_I2C.h>
#define I2C_ADDR 0x27
#define LCD_COLUMNS 16
#define LCD_LINES 2
uint8_t state;
uint8_t valIndex;
uint8_t cursorPos;
char entered_value [6];
const uint8_t ROWS = 4;
const uint8_t COLS = 4;
char keys[ROWS][COLS] = {
{ '1', '2', '3', 'A' },
{ '4', '5', '6', 'B' },
{ '7', '8', '9', 'C' },
{ '*', '0', '#', 'D' }
};
uint8_t colPins[COLS] = { 1, 0, 3, 2 };
uint8_t rowPins[ROWS] = { 4, 5, 6, 7 };
LiquidCrystal_I2C lcd(I2C_ADDR, LCD_COLUMNS, LCD_LINES);
Keypad keypad = Keypad(makeKeymap(keys), rowPins, colPins, ROWS, COLS);
void setup()
{
Wire.begin(18, 19);
lcd.init();
lcd.backlight();
lcd.clear();
}
void loop()
{
char key = keypad.getKey();
if (key == '1')
{
lcd.print("hello");
}
}