Hi all,
I know that's likely a noob question, but it's 2 days I'm trying to figure it out and I can't get anything out of it.
First experience with Arduino, no big previous experience with electronics in general (I have a big of general knowledge, nothing too specific), so I apologize in advance if I say something stupid.
Down to the issue: I bought an Arduino nano ESP32 ( https://docs.arduino.cc/tutorials/nano-esp32/cheat-sheet/ ), and a backlit LCD display 16x2 (that arrived with some bent pins, but y the look of it everything else seems fine... as fine as it may look).
I followed some tutorials on ho to wire things up and the screen lights up and shows the 1st row of white boxes (i.e. as far as I understood the LCD is ready to be initialized).
I have the potentiometer for contrast and it's working.
But, as you may expect, when I try to write something to the screen nothing is shown.
I saw several similar cases on the forum, tried to understand what I am doing wrong, but couldn't figure it out.
So, the current schema I have is:
Column 1 | Column 2 | Column 3 | Column 4 |
---|---|---|---|
LCD pin | Arduino PIN | ||
VSS | Ground | ||
VDD | +5V | ||
V0 | (central pin potentiometer) | ||
RS | D9 | ||
RW | ground | ||
E | D8 | ||
D4 | D4 | ||
D5 | D5 | ||
D6 | D6 | ||
D7 | D7 | ||
A | +5V with a 6.7kOhm resistor | ||
K | ground |
The code looks like this:
#include <LiquidCrystal.h>
const int rs = 18, en = 17, d4 = 7, d5 = 8, d6 = 9, d7 = 10;
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.setCursor(0, 0);
lcd.print("hello, world!");
lcd.setCursor(0, 1);
lcd.print("bye, world!");
pinMode(LED_BUILTIN, OUTPUT);
}
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);
digitalWrite(LED_BUILTIN, HIGH);
delay(250);
digitalWrite(LED_BUILTIN, LOW);
delay(250);
}
Do you see anything wrong with what I've done? And what it would be?