Variable length debugger
This commit is contained in:
parent
5f2271582c
commit
95de8af77d
2 changed files with 2 additions and 4 deletions
|
@ -60,7 +60,7 @@ class Message:
|
|||
if message_type == 0:
|
||||
return "REGISTER"
|
||||
elif message_type == 1:
|
||||
return f"STRIKE {self.payload[5]}"
|
||||
return f"STRIKE {self.payload[1]}"
|
||||
elif message_type == 2:
|
||||
return f"SOLVED"
|
||||
else:
|
||||
|
|
|
@ -14,13 +14,11 @@ void setup() {
|
|||
}
|
||||
|
||||
void loop() {
|
||||
char message[9];
|
||||
message[8] = '\0';
|
||||
struct can_frame receive_frame;
|
||||
if (mcp2515.readMessage(&receive_frame) == MCP2515::ERROR_OK) {
|
||||
Serial.print("message ");
|
||||
Serial.print(receive_frame.can_id, DEC);
|
||||
for (int i = 0; i < 8; i++) {
|
||||
for (int i = 0; i < receive_frame.can_dlc; i++) {
|
||||
Serial.print(" ");
|
||||
Serial.print(receive_frame.data[i], DEC);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue