Please help me figure out what I'm doing wrong here, code below:
// include the library code: #include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(19, 23, 18, 17, 16, 15);
void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print("circuitschools.");
}
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);
}
The correct way to wire the contrast pot is to wire one end of the pot to ground and the wiper to pin 3. This actually makes adjusting contrast easier. The other end of the pot not connected or connected to the wiper. The long standing advice that the pot is wired to ground, Vcc and pin 3 is wrong. It is an error perpetuated over many years that begs correction.
Just disconnect the wire from the pot to Vcc. The pot is used as a variable resistor to complete a resistor chain, not a potentiometer voltage divider.
Okay cool, yeah i have done that. removed the 5v connection from the pot so its only gnd in and out to V0 this is just before the blocks on the top row disappear:
For the photos to have value, they need to, clearly, show the wire going to both ends. Wires that go out of the photo and back in are impossible to, accurately, trace.
Show how the pot is now wired.
I wired a known good 1602 display to my WSP32 DevKit module and loaded the posted code with no changes. My display has a 1K fixed resistor from ground to pin 3 (Vo) of the LCD to provide good contrast. The display shows "circuitschools." on the top row and a 1HZ ish count incrementing on the bottom row.
So it is not the code, must be wiring or a bad display. Out of, maybe, 30 that I have obtained (Ebay and Amazon) 2 were DOA so it is not unheard of.