MichaelMeissner:
StuHooper:
If I want to split a 140 char array into chars of 21 length for display on an LCD screen, what command/s do I need to do so?This program logically does:
static const int lcd_width = 20;
void print_large_array (const char *array, size_t len)
{
size_t i;
char small_array[21];
if (len == 0)
len = strlen (array); // figure out length if not passed
while (len > 0) {
size_t len2 = (len > lcd_width) ? lcd_width : len;
for (i = 0; i < len2; i++)
small_array[i] = array[i];
small_array[len2] = '\0';
lcd.println (small_array);
array += len2; // reset pointer/len for next iteration
len -= len2;
}
}
Thanks. I found this works, although due to having to draw a graphic.box to the screen before each line of code, I can't have it scrolling very fast. This seems to be interfering with my Ethernet connection as it's holding up my loop();