Hot answers tagged

6

instead of 9, it printed 90 No, it didn't: it printed “9”. However, it did not erase the previous value before printing “9”. Before printing the 9, the LCD had: ┌────────────────┐ │time left │ │10 │ └────────────────┘ ^cursor position When you printed “9”, that character replaced the “1”, and you end up seeing “90”. The fix, as pointed ...


2

The object called lcd that you create inside the setup function is a local variable. It only lives as long as that function is executing - so not very long. It doesn't exist outside that function. The lcd object you have in namespace display on the other hand is a global variable. That one lives as long as your program, which means until you reset your ...


Only top voted, non community-wiki answers of a minimum length are eligible