Hi,I have a CAN-BUS shield of version 1. I also download the library from GitHub and renew them. Those example project runs successfully. However, I am confused what is the ID of this shield? I found there is a function named as 'sendMsgBuf()' in the class 'mcp_can'. Is it the way to set CAN-ID for this shield? if it is, how to set its parameters, such as 'ext', 'rtrBit'?Thanks.
It works now. It shows the CAN-ID was set by function of 'sendMsgBuf()'. For example, I set the unit connected the canshield with ID of 0x02, then the code could be written as 'CAN.sendMsgBuf(0x02,0,8,buf)'. Where '8' means 8 bytes will be send out, which are stored in buf. I used a usb-can to monitor any message on the CAN bus.
...with ID of 0x02, then the code could be written as 'CAN.sendMsgBuf(0x02,0,8,buf)'. Where '8' means 8 bytes will be send out, which are stored in buf.
Hello! I can not understand what is happening in the MCP_CAN_lib-master library"The readMsgBuf (* ID, * DLC, * DATA)If the ID is AND 0x80000000, the ID is of the Extended type, it would be standard.If the ID AND 0x40000000 EQUALS 0x40000000, the message is a remote request.The sendMsgBuf (ID, DLC, DATA) function can send extended or standard IDs.To mark the ID as extended, OR the ID with 0x80000000.To send a remote request, OR the ID with 0x40000000. "Why we use 0x80000000 (B100000000000000000000000000000) and 0x40000000 (B10000000000000000000000000000),in datashite MCP2515 bits IDE and RTR are in other positions?Extended ID|ID10||||||||||ID0|SRR|IDE|EID17||||||||||||||||EID0|RTR|
Not quite right...'CAN.sendMsgBuf(0x02,0,8,buf)' will transmit a CAN FRAME With ID 0x02 and a data length (DLC) of 8 bytes. ID 0x02 by no means is the 'ID' of your shield. Your device can very well transmit more than one CAN IDREAD UP ON HOW CAN COMMUNICATION WORKS!
Now I become confused again on how to communicate between several ECUs....