LCD troubleshooting (16 x 2 parallel)

I figured it out. I thought that the pin numbers and the pin names on the blue pill pinout diagrams were synonymous, turns out they're not I guess? Anyway if I replace the pin numbers with the pin designations as shown below, everything works as it should. Thanks again for your response Dougie, you got me thinking.

#include <LiquidCrystal.h>

// rs = register select, rw = read/write, en = enable writing to shift registers
const int rs = 26, en = 21, d0 = 19, d1 = 25, d2 = 28, d3 = 27, d4 = 29, d5 = 38, d6 = 22, d7 = 18;
// LiquidCrystal lcd(rs, en, d0, d1, d2, d3,  d4, d5, d6, d7);
LiquidCrystal lcd(PB13, PB10, PB1, PB12, PB15, PB14, PA8, PA15, PB11, PB0);

void setup() 
{
  lcd.begin(16, 2);
}

void loop()
{
  lcd.clear();    
  lcd.setCursor(0,0);
  lcd.print("Hello World");
  delay(200);
}
1 Like