PlatformIO package of the Teensy core framework compatible with GCC 10 & C++20
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

FastCRC_CRC8.ino 496B

3 years ago
123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. FastCRC-Example
  3. (c) Frank Boesing 2014
  4. */
  5. #include <FastCRC.h>
  6. FastCRC8 CRC8;
  7. uint8_t buf[9] = {'1', '2', '3', '4', '5', '6', '7', '8', '9'};
  8. void setup() {
  9. delay(1500);
  10. Serial.begin(115200);
  11. Serial.println("CRC Example");
  12. Serial.println();
  13. Serial.print("SMBUS-CRC of \"");
  14. for (unsigned int i = 0; i < sizeof(buf); i++) {
  15. Serial.print((char) buf[i]);
  16. }
  17. Serial.print("\" is: 0x");
  18. Serial.println( CRC8.smbus(buf, sizeof(buf)), HEX );
  19. }
  20. void loop() {
  21. }