CANhack.de CAN-Interface RKS+CAN
CAN Hardware, CAN Software, CAN Protocols - CAN Bus Forum for Your CAN Bus Project.

Arduino with MCP2515 as a controller

 
New Topic Reply 🔗 🖨 CANhack.de - Index » Microcontrollers and Electronics, Programming
Author Message
Aggro600



Joined: 10/29/2017
Posts: 2
Karma: +0 / -0   Thank you, like it!


Free account, no CAN development support

Post29-10-2017, 2:23    Subject: Arduino with MCP2515 as a controller Quote

I have an Arduino and an MCP2515, and I'm using this library:
https://github.com/coryjfowler/MCP_CAN_lib
I can also receive data, but how do I compare it now?
Assuming we receive the message with ID=25A and Message=5,5,5,5,5,5,5,5.
Now, I want to execute some code.
I only ever find examples of how to set the internal filter.


Translated on 05-07-2026, 12:24.
Back to top Profile PM
postmann
CAN-Profi
CAN-Profi


Joined: 05/23/2013
Posts: 142
Karma: +63 / -0   Thank you, like it!


CAN Support

Post29-10-2017, 11:22    Subject: Arduino with MCP2515 as a controller Quote

I haven't quite understood the problem yet. You are receiving a CAN frame with corresponding data, and you want to perform some action based on that data?

I assume that you have received the data correctly and are caching it for further use. Then you can query them using a regular conditional statement.

Okay, gib mir den deutschen Text.

if (Byte[0] == 0x01h)
"Please provide the text you would like me to translate from German to English."
do something if the first byte of the CAN message contains a 1...
Bitte gib mir den deutschen Text, den du übersetzt haben möchtest.


Translated on 05-07-2026, 12:25.
Back to top Profile PM
GerdJ
CAN-Profi
CAN-Profi


Joined: 09/08/2014
Posts: 45
Karma: +12 / -0   Thank you, like it!


Premium Support

Post31-10-2017, 21:09    Subject: Arduino with MCP2515 as a controller Quote

Sure, here's the translation of the German text into English, with double equals signs for "C":

"In C, please use double equals signs."

if (Byte[0] == 0x01h)
Bitte gib mir den deutschen Text, den du übersetzt haben möchtest.
Do something if the first byte of the CAN message contains a 1.
Bitte gib mir den deutschen Text, den du übersetzt haben möchtest.


Translated on 05-07-2026, 12:27.
Back to top Profile PM
New Topic Reply 🔗 🖨 CANhack.de - Index » Microcontrollers and Electronics, Programming
Similar articles and topics
Topic Forum
No new posts Arduino BlackBox mit MCP2515 Microcontrollers and Electronics, Programming
No new posts Reading data from a car using Arduino and MCP2515 Microcontrollers and Electronics, Programming
No new posts Arduino + MCP2515: Signals "blocked"? Microcontrollers and Electronics, Programming
No new posts VW MFD Steuerung Interior / Comfort CAN
Jump to:  
You cannot post new topics in this forum.