GY-63_MS5611/libraries/CRC/examples/CRC_test/CRC_test.ino

48 lines
866 B
Arduino
Raw Normal View History

2023-08-01 11:27:01 -04:00
//
// FILE: CRC_test.ino
// AUTHOR: Rob Tillaart
// PURPOSE: demo
// DATE: 2020
// (c) : MIT
//
2021-01-29 06:31:58 -05:00
#include "CRC.h"
#include "printHelpers.h" // for the 64 bit...
char str[24] = "123456789";
2021-12-14 14:22:40 -05:00
2021-01-29 06:31:58 -05:00
void setup()
{
Serial.begin(115200);
Serial.println(__FILE__);
uint8_t * data = (uint8_t *) &str[0];
2022-01-28 08:56:11 -05:00
Serial.println("Verified with - https://crccalc.com/ \n");
2021-01-29 06:31:58 -05:00
2023-08-01 11:27:01 -04:00
// use default parameters for calcCRCxx()
2021-01-29 06:31:58 -05:00
Serial.print("TEST:\t");
Serial.println(str);
Serial.print("CRC8:\t");
2023-07-13 05:08:10 -04:00
Serial.println(calcCRC8(data, 9), HEX);
2021-01-29 06:31:58 -05:00
Serial.print("CRC16:\t");
2023-07-13 05:08:10 -04:00
Serial.println(calcCRC16(data, 9), HEX);
2021-01-29 06:31:58 -05:00
Serial.print("CRC32:\t");
2023-07-13 05:08:10 -04:00
Serial.println(calcCRC32(data, 9), HEX);
2021-01-29 06:31:58 -05:00
// Serial.print("*CRC64:\t");
2023-07-13 05:08:10 -04:00
// uint64_t t = calcCRC64(data, 9);
2021-01-29 06:31:58 -05:00
// Serial.println(print64(t, HEX));
Serial.println("\n\nDone...");
}
2021-12-14 14:22:40 -05:00
2021-01-29 06:31:58 -05:00
void loop()
{
2023-08-01 11:27:01 -04:00
}
// -- END OF FILE --