Here my sample code for an Arduino Leonardo-based custom board:
#include <LiquidCrystal.h>
const int rs = 3, en = 0, d4 = 4, d5 = 30, d6 = 12, d7 = 6;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
void setup()
{
pinMode(2, OUTPUT);
digitalWrite(2, LOW);
Serial.begin(115200);
lcd.begin(16, 2);
lcd.print("Hello world");
}
void loop()
{
}
And here my schematic:
The MCU is an ATmega32U4. Running the code above the display is completely empty, I also tried to change the values of R4 and R5 but nothing changes. I don't see anything, not even the background of each character.
The display is a common HD44780 compatible one.
I retrieved the pin numbers from here:
/opt/arduino-1.8.19/hardware/arduino/avr/variants/leonardo/pins_arduino.h
Am I missing anything?