Lcd1602 Hello world example prints hello, world but not counting

To me, it appears that this library: #include <LiquidCrystal.h> is blocking timer0, maybe by suspending interrupts. This causes delay() to spin wildly see [SOLVED] Why does delay() not hang in an ISR?. It could well be that a recent update to the IDE has disturbed the functioning of an old library, especially if some obscure low level programming was used, possibly relying on some non-documented feature.

The results shown in post #13 (no LiquidCrystal library) look good.

Were these tests below on various platforms performed with or without the LiquidCrystal library ?

Interesting would be to try this. It is the code in the OP with one addition.

#include <LiquidCrystal.h>

const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
int i=0;

void setup() {
  lcd.begin(16, 2);
  lcd.print("hello, world!");
}

void loop() {
  lcd.setCursor(0,1);
  lcd.print(i);
  i++;
  interrupts() ; //  RESUME INTERRUPTS TO SEE IF THIS IS THE ISSUE
  delay(1000);
}
2 Likes