LCD not giving desired output
LCD not giving desired output
I am learning Arduino and I was making one program which will print "Hello" to the lcd display connected to arduino.
I dont know what is wrong but the LCD is not showing desired output, rather shows special characters and when I increase/decrease the contrast of lcd using the Potentiometer, the characters changes everytime.
my code is:
// include the library code:
#include <LiquidCrystal.h>
// initialize the library by associating any needed LCD interface pin
// with the arduino pin number it is connected to
const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print("hello");
}
void loop() {
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0):
lcd.setCursor(0, 1);
// print the number of seconds since reset:
lcd.print(millis() / 1000);
}
Please help.
Can you recheck the circuit: arduino.cc/en/Tutorial/HelloWorld
– J J
Jun 30 at 8:18
I'm voting to close this question as off-topic because it's not a programming problem. If the example program doesn't work, then it's a problem with hardware.
– gre_gor
Jun 30 at 13:29
Also voted as off-topic. Stack overflow is meant for programming related, problems. Please post this question on electronics.stackexchange.com, or arduino.stackexchange.com
– Nitro
Jun 30 at 15:52
1 Answer
1
Check what kind of lcd you are using.
Some lcd's come with the pin numbering reversed. IE the location of the 16 pins is on the top left corner, but instead of starting with pin number 1, the lcd starts with pin number 16.
Since the format of the LCD pins is the same both way (GND, VCC, input * 14, vcc, Gnd) it does not cause shorting problems, But the control signals are sent to the data pins, and the data signals are sent to the control pins.
I got this hint from the fact that changing the brightness changes the characters. If I am right, changing the contrast via the potentiometer will do you no good with respect to the actual contrast.
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Have you commoned the grounds of LCD and Arduino?
– J J
Jun 30 at 8:13