GY-63_MS5611/libraries/Fletcher/examples/Fletcher16_echo/Fletcher16_echo.ino

38 lines
521 B
Arduino
Raw Normal View History

2022-01-27 04:11:25 -05:00
//
// 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 --