Go Down

Topic: question of code display (Read 861 times) previous topic - next topic


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);

  Serial.println(val);             // debug value


Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp



Nov 27, 2012, 11:30 am Last Edit: Nov 27, 2012, 11:33 am by dxw00d Reason: 1
Does it compile? What happens when you run it?

You might need to add
Code: [Select]
#include <Wire.h>
at the top.


if code is true?

If you are asking if the code does what you want it to, only you can answer that.  Run the code and see.  It will not harm your Arduino to try.
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131