Readline

Ein Ausschnitt aus dem Code:

char lcdline[256];
int index = 0;
int16_t c;
while ((c = file.read()) > 0) {
// If it isn't a new line, add the character to the buffer
if (c != '\n' && c != '\r') {
lcdline[index] = c;
index++;
//Serial.print(c);

// continue to read more data!
continue;
}
else
{
// got a \n or \r new line, which means the string is done
lcdline[index] = 0;
index = 0;
Serial.println(lcdline);
//Tue irgend etwas
for (int i=0; i<256; i++){
lcdline = 0;

  • }*
  • }*
  • }*
    Im Serial Monitor wird nach dem das Zeilenende ereicht ist der arduino zurückgesetzt.