PlatformIO package of the Teensy core framework compatible with GCC 10 & C++20
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

37 lines
499B

  1. /*
  2. FastCRC-Example
  3. (c) Frank Boesing 2014
  4. */
  5. #include <FastCRC.h>
  6. FastCRC16 CRC16;
  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("CCITT-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( CRC16.ccitt(buf, sizeof(buf)), HEX );
  19. }
  20. void loop() {
  21. }