I need help with a code to convert an AnalogIn input on the mbed LPC1768 to digital to be used by the CAN controller.The example syntax I'm using is
if(can1.write(CANMessage(1337, &counter, 2))) {
..........
}
where "counter
" is the data to be transmitted and defined by me as a signed int (the example however defines it as a char). But I keep getting an error message
Error: No instance of constructor "mbed::CANMessage::CANMessage" matches the argument list in "project_test.cpp"
The controller CANMessage syntax is
CANMessage(int _id, const char *_data, char _len = 8, CANType _type = CANData, CANFormat _format = CANStandard) {
len = _len & 0xF;
type = _type;
format = _format;
id = _id;
memcpy(data, _data, _len);
}
I really do not understand the controller syntax and how to apply it. Any help in explaining would be appreciated. Thanks