ArduinoGeneral

CAN BUS Shield

userHead Account cancelled 2019-07-02 15:20:13 1613 Views0 Replies
Hi, I'm working on a project to connect my Arduino to HMI using CAN BUS Shield V2.0 https://wiki.dfrobot.com/CAN-BUS_Shield ... __DFR0370_. I have a problem with the address setting. The HMI asks for address with the format of HHHHHHHHBbNN with H : ID, B : byte positon (1~8), b : bit positioni (1~8), NN : bit no. (1~64).

If I'm sending the data from my Arduino, simple 1 and 0 data with this code how should I input the address required in the HMI?
Code: Select all
unsigned char data[8];

void loop() {
  for (int i=0; i<=7; i++) {
    data[i] = 1;
  }

  CAN.sendMsgBuf(1234, 0, sizeof(data), data); 
  delay(500);
}