Hi.
Im building a mailbox with a screen that changes the message wheter you have mail or not, but I need some help with my code.
This is what I have for the moment, but it doesnt seem to work like I would like it to.
#include <LiquidCrystal.h>
#include <LCDKeypad.h>
LCDKeypad lcd;
const int threshold = 100;
const int analogPin = A0;
void setup() {
int analogValue = analogRead(analogPin);
if (analogValue > threshold)
{
lcd.begin(16, 2);
lcd.print("text1");
}
else
{
lcd.begin(16, 2);
lcd.print("text2");
}
}
void loop() {
}
Any help is higly appriciated!
Be sure to tell me some suggestons, if I should use a photoresistor or not.