So I need help with my code, I'm trying to display the tempurature on my LCD1602 (Arduino Uno R3) and my code isn't working, here it is:
//Project: Photocell or Photoresistor and LCD 1602 display
//Function: You will see the temperature from photoresistor on LCD 1602 display
//***************************************************************** #include <LiquidCrystal.h> //include the library code
//*****************************************************************
const int photoPin = A1; //photoresistor attached to analog pin A1
int Val = 0; //local variable to store the reading from your sensor
LiquidCrystal lcd(4,5,9,10,11,12);//initialize the library with the numbers of the interface pins
//*****************************************************************
void setup()
{
lcd.begin(16, 2); //setup the LCD's number of columns and rows
Serial.begin(9600); //initialize serial communications at 9600 bps
void loop()
{
Val = analogRead(photoPin); //read the temperature from sensor
lcd.setCursor(0, 0); //set the cursor to column 0, line 0
lcd.print("Photoresistor : ");//print word Photoresistor: on LCD display
lcd.setCursor(11, 0); //set the cursor to column 11, line 0
lcd.print(Val); //print the temperature on LCD display
Serial.println(Val); //print the temperature in serial monitor
delay(1000); //set the delay 1 second
lcd.setCursor(11, 0); //set the cursor to column 11, line 0
lcd.print(" "); //clear the temperature value on LCD display
}
//Project: Photocell or Photoresistor and LCD 1602 display
//Function: You will see the temperature from photoresistor on LCD 1602 display
//*****************************************************************
#include <LiquidCrystal.h> //include the library code
//*****************************************************************
const int photoPin = A1; //photoresistor attached to analog pin A1
int Val = 0; //local variable to store the reading from your sensor
LiquidCrystal lcd(4,5,9,10,11,12);//initialize the library with the numbers of the interface pins
//*****************************************************************
void setup()
{
lcd.begin(16, 2); //setup the LCD's number of columns and rows
Serial.begin(9600); //initialize serial communications at 9600 bps
void loop()
{
Val = analogRead(photoPin); //read the temperature from sensor
lcd.setCursor(0, 0); //set the cursor to column 0, line 0
lcd.print("Photoresistor : ");//print word Photoresistor: on LCD display
lcd.setCursor(11, 0); //set the cursor to column 11, line 0
lcd.print(Val); //print the temperature on LCD display
Serial.println(Val); //print the temperature in serial monitor
delay(1000); //set the delay 1 second
lcd.setCursor(11, 0); //set the cursor to column 11, line 0
lcd.print(" "); //clear the temperature value on LCD display
}