Leading 0 are not printed
Leading 0 are not printed, for instance I should receive this data : 6000220100000000, instead I receive this : 6002210000.
I've modified the code as follows:
........ ........ ........ // only print packet data for non-RTR packets while (CAN.available()) { Serial.print(CAN.read(),HEX); ....... ....... ....... .
For better and easier workfolw, Try to read out the raw buffer of the Can Controler.
I used the Pull from here:
https://github.com/deltaphi/arduino-CAN/tree/deltaphi/master
Declare array:
uint8_t CanB[8];
if (CAN.available()) { CAN.readBytes(CanB, 8); // 8 bytes
byte1 = CanB[0]
byte2 = CanB[1]
byte3 = CanB[2]
byte4 = CanB[3]
.... etc }
Now you can declare a Array of your size and read all raw data.
maybe you are sending RTR packeds that get ignored?