Hello!
I was wondering what the most barebones code for transmitting a command if a condition is met can be over the CAN BUS could be. Hypothetically I would want to send something along the lines of: "3D 11 04 00 C3" on the CAN BUS if the speedometer reads 20 km/h. I found this:
include "carloop/carloop.h"
Carloop carloop;
void setup()
{
carloop.begin();
}
void loop()
{
carloop.update();
CANMessage message;
if(carloop.can().receive(message)) {
// Do awesome things with message!
}
}
AND THIS:
Velocity: 0x3CA
Expressed in:[km] h
Frequency: 6.7 Hz
Minimum Timestamp: 100
But I think that I am missing something. Ideally I would want this to be standalone (so no serial printing required). What could I do?
P.S.
How does one turn 8 bit messages in hex numbers?
Thank you very much