check if msg received
This commit is contained in:
parent
579c15cc95
commit
d9edd16d7a
1 changed files with 9 additions and 9 deletions
|
@ -11,17 +11,17 @@ void setup() {
|
|||
void loop() {
|
||||
twai_message_t rx_frame;
|
||||
|
||||
ESP32Can.CANReadFrame(&rx_frame);
|
||||
if (ESP32CAN_OK == ESP32Can.CANReadFrame(&rx_frame)) { /* CAN message received*/
|
||||
Serial.print(rx_frame.identifier, HEX);
|
||||
Serial.print(" ");
|
||||
Serial.print(rx_frame.data_length_code);
|
||||
|
||||
Serial.print(rx_frame.identifier, HEX);
|
||||
Serial.print(" ");
|
||||
Serial.print(rx_frame.data_length_code);
|
||||
for (int i=0; i<rx_frame.data_length_code; i++) {
|
||||
Serial.print(rx_frame.data[i], HEX);
|
||||
}
|
||||
|
||||
for (int i=0; i<rx_frame.data_length_code; i++) {
|
||||
Serial.print(rx_frame.data[i], HEX);
|
||||
Serial.println();
|
||||
}
|
||||
|
||||
Serial.println();
|
||||
|
||||
delay(1000);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue