As mentioned in the title I'm facing a problem in printing strings in the LCD. It's printing actually weird characters.
#include <LiquidCrystal.h>
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);
void setup() {
lcd.begin(16, 2);
Serial.begin(9600);
lcd.print("hello, world!");
}
void loop() {
lcd.setCursor(0, 1);
lcd.print(millis()/500);
}
You can find the output of the LCD in the picture below:
-
5You've goofed up the hardware side.Ignacio Vazquez-Abrams– Ignacio Vazquez-Abrams2016年02月01日 13:13:06 +00:00Commented Feb 1, 2016 at 13:13
-
2Agreed - it certainly hasn't initialized properly - it's in 16x1 mode not 16x2 mode, which means the 16x2 instruction never got through, so most likely you have your data lines in the wrong order.Majenko– Majenko2016年02月01日 13:24:20 +00:00Commented Feb 1, 2016 at 13:24
-
3And that looks like some pretty shoddy soldering. That's a good example of go home and do it again.CharlieHanson– CharlieHanson2016年02月01日 19:19:33 +00:00Commented Feb 1, 2016 at 19:19
1 Answer 1
Whenever I use an LCD display I make sure to use the I2C backpack. It takes actual effort to hook it up wrong if you use them. So if this were me, I would desolder all those pins and get one.
Here is a good description of how they work: https://learn.adafruit.com/i2c-spi-lcd-backpack/overview
-
1Exactly my thought. It is possible to do the wiring and protocol yourself, but it will require a lot of pins and probably cause you some headaches.aaa– aaa2016年12月11日 20:18:48 +00:00Commented Dec 11, 2016 at 20:18
Explore related questions
See similar questions with these tags.