Hey!
Im building a mailbox, and i could really ned some help with a code. I need a text on the keypad library to change to another text on a 1602 LCD when the light is blocked by the photoresistor (if, else). Any kind of help is higly appriciated!
Hey!
Im building a mailbox, and i could really ned some help with a code. I need a text on the keypad library to change to another text on a 1602 LCD when the light is blocked by the photoresistor (if, else). Any kind of help is higly appriciated!
Is your question related to this one?
Yes! I didn't quite get i to work with the photoresistor...
Any output or observations to look at?
I have the code...
#include <LiquidCrystal.h>
#include <LCDKeypad.h>
LCDKeypad lcd;
const int threshold = 600;
const int analogPin = A0;
int sensorMin = 1023; // minimum sensor value
int sensorMax = 0; // maximum sensor value
int sensorValue = 0; // the sensor value
void setup() {
}
void loop() {
sensorValue = analogRead(analogPin);
if (sensorValue > sensorMax)
{
lcd.begin(16, 2);
lcd.print("POSTKASSE V.1.1");
lcd.setCursor(0,1);
lcd.print("Du har post!");
}
else
{
lcd.begin(16, 2);
lcd.print("POSTKASSE V.1.1");
lcd.setCursor(0,1);
lcd.print("Du har ikke post");
}
delay(150);
}
Ok, does any print occur and why is it not correct?
The Photoresitor won't change anything on the screen, thats what I need help for. I do not know the value to the anlog input or what code I should use for this.
pot82es Hi Kristoffer - surely you should be printing out the value of sensorValue that you are reading at:
sensorValue = analogRead(analogPin);
and do this at different light levels
Neil
pot82es Hi Kristoffer - surely you should be printing out the value of sensorValue that you are reading at:
sensorValue = analogRead(analogPin);
and do this at different light levels
Neil