Ein paar Zeilen zum Ausprobieren:
// Quelle der Bibliothek: https://github.com/duinoWitchery/hd44780
#include <Wire.h>
#include <hd44780.h> // include hd44780 library header file
#include <hd44780ioClass/hd44780_I2Cexp.h> // i/o expander/backpack class
hd44780_I2Cexp lcd; // auto detect backpack and pin mappings
#define LCD_COLS 20
#define LCD_ROWS 4
const char begr[] = {","};
//char * strtok ( char * str, const char * delimiters );
const byte MESSAGE_LENGTH = 35;
char inputData[MESSAGE_LENGTH];
void setup() {
Serial.begin(9600);
Serial.println(F("\nAnfang"));
Serial1.begin(9600);
lcd.begin(LCD_COLS, LCD_ROWS);
lcd.print("Messwert");
for (byte j = 0; j < MESSAGE_LENGTH; j++)
{
inputData[j] = ' ';
}
}
void loop() {
if (Serial1.available() > 0)
{
char zeichen = Serial1.read();
if (zeichen == '\n')
{
inputData[MESSAGE_LENGTH - 1] = '\0';
Serial.println();
Serial.println(inputData);
Serial.print(inputData + 23);
lcd.setCursor (0, 1);
lcd.print(inputData + 23);
for (byte j = 0; j < MESSAGE_LENGTH; j++)
{
inputData[j] = ' ';
}
} else {
Serial.print(zeichen, HEX);
Serial.print(' ');
if (zeichen > 31)
{
for (byte j = 0; j < MESSAGE_LENGTH - 2; j++)
{
inputData[j] = inputData[j + 1];
}
inputData[MESSAGE_LENGTH - 2] = zeichen;
}
}
}
}