GY-63_MS5611/libraries/Fletcher/examples/Fletcher16_echo/Fletcher16_echo.ino
2022-01-27 10:11:25 +01:00

38 lines
521 B
C++

//
// FILE: Fletcher16_echo.ino
// AUTHOR: Rob Tillaart
// PURPOSE: echo's Fletcher checksum after every character.
#include "Arduino.h"
#include "Fletcher16.h"
Fletcher16 fl;
void setup()
{
Serial.begin(115200);
while (!Serial);
Serial.println();
Serial.println("Fletcher16_echo");
fl.begin();
}
void loop()
{
if (Serial.available())
{
uint8_t c = Serial.read();
fl.add(c);
Serial.print(c);
Serial.print("\t");
Serial.println(fl.getFletcher());
}
}
// -- END OF FILE --