i connect ct sensor to arduino and i connect lcd to arduino.
i want to read analog input (current of lamp) and display the value to lcd
this code is true:
#include <LiquidCrystal.h> // include the LCD library
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int analogPin = A0;
int val = 0;
void setup()
{
Serial.begin(9600); // setup serial
lcd.begin(16, 2); // lcd rows and columns
lcd.print("lampe"); // title
}
void loop()
{
val = analogRead(analogPin); // read the input pin
lcd.setCursor(0, 1);
lcd.print("lampe=");
lcd.print(val);
Serial.println(val); // debug value
}