Recursion

I’m still getting used to the limited memory thing. Is a recursive call like this going to give me problems? It never gets called with _digits > 4. Would it cause potential problems with a deeper stack of recursions?

template<class T>
void padNumber(const T& _var, int _digits)
{
  T _place = _var % 10;
  if (_digits > 1)
  {
    padNumber( (_var / 10), (_digits - 1) );
  }
  LCD.print(_place);
  return;
}

I'm guessing each time you recurse you will use 6 to 8 bytes or so. So four times is OK.

Would it cause potential problems with a deeper stack of recursions?

Depending on what else you have in your program you can work that out. Probably.

I had a maze generator that recursed. It only got up to about a 5 x 5 maze. Changing to a non-recursing algorithm I got a much larger maze out of it.

Sometimes recursion is the right answer, but printing a number in decimal hardly seems like a good reason.

Can't you just format the number to a string and then tell the LCD to display the string? Or if you really need to do it character by character, use a loop (iteration) instead of recursion.