Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using the entire frame structure in the arduino code for mcp2515 #26

Open
krish97git opened this issue Oct 14, 2019 · 0 comments
Open

Comments

@krish97git
Copy link

Hey i'm trying to interface arduino and mcp2515 with busmaster through a Peak USB device.
But since there is some problem with the usage of the frame structure, bus master is neither able to transmit or receive data. So the question is how do I code the entire frame for transmitting or receiving. Examples maybe Start of frame, Arbitration field and the control field. The code needs to follow the same format.
canMsg.can_id = 0x036; //CAN id as 0x036
canMsg.can_dlc = 8; //CAN data length as 8
canMsg.data[0] = h; //Update humidity value in [0]
canMsg.data[1] = t; //Update temperature value in [1]
canMsg.data[2] = 0x00; //Rest all with 0
canMsg.data[3] = 0x00;
canMsg.data[4] = 0x00;
canMsg.data[5] = 0x00;
canMsg.data[6] = 0x00;
canMsg.data[7] = 0x00;
mcp2515.sendMessage(&canMsg); //Sends the CAN message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant