/*
Photoresistor (LDR) Analog Demo
Copyright (C) 2021 Uri Shaked.
https://wokwi.com/arduino/projects/305193627138654786
*/
#include <LiquidCrystal_I2C.h>
#define LDR_PIN 2
// LDR Characteristics
const float GAMMA = 0.7;
const float RL10 = 50;
int a =0;
LiquidCrystal_I2C lcd(0x27, 20, 4);
int flag0=1;
int flag1=1;
int laststat0=1;
int laststat1=1;
void setup() {
pinMode(LDR_PIN, INPUT);
Serial.begin(9600);
lcd.init();
lcd.backlight();
}
void loop() {
int analogValue0 = analogRead(A0);
int analogValue1 = analogRead(A1);
lcd.setCursor(0,0);
Serial.println(analogValue0);
delay(500);
}