analog in to 4 bit LCD driver

Hi Dave,

Thanks for the 4-line display tip.

As it stands, does that 4bit library work for your 4-line LCD display without changing the code, if you just run it in 1 or 2 line mode and don't try to access the other positions?

I'm not too worried about the cursorTo() function yet. I imagine a lot of people would comment that function out to save space, anyway. If we can't easily make an across-the-board implementation of it, so be it.

The HD44780 standard is probably as much as I'd have the LCD4Bit library support, for now, and it doesn't seem to cover >2-line displays. People can always send a custom command to change the display mode AFTER lcd.init(), I guess. My understanding is that the only crucial thing that HAS to be right in a 4-bit library is the sequence indicating 4-bit (not 8-bit). If that's wrong then all subsequent commands are incorrectly interpreted.
Do you have a link to your 4-line LCD's datasheet?

One thing I'm keen on is that eventually there's a direct mapping between what's written on a datasheet and what's being done in our init(). It's so much better, for learners in particular, when one can follow that link and understand all the code, line for line. I wasted energy following my component-specific datasheet in developing the 4-bit version of the lib, but I'll come back to the code this week and try to find a definitive source for the HD standard.

LCD-tech aside, one small thing I noted in your code was the extra work you were doing to convert the multidigit decimal number to a string on the lcd.

You can use the standard function atoi() to convert an integer to a string. (That function isn't big, unlike sprintf, which uses about 1.5k!)

  int heat = 451;      
  char heat_str[4] = "   ";  //reserve the string space first
  itoa(heat, heat_str, 10);
  lcd.printIn(heat_str);

  //todo: make sure number can be notated within str length.

This assumes you make a string-printing function (here printIn()) for the lcd. This can simply be a wrapper to multiple calls to your character printing fn. (As seen in the original tutorial).

Neill