check if msg received

This commit is contained in:
Sam Perry 2022-12-23 13:20:26 -05:00
parent 579c15cc95
commit d9edd16d7a

View file

@ -11,8 +11,7 @@ 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);
@ -22,6 +21,7 @@ void loop() {
}
Serial.println();
}
delay(1000);
}