CANhack.de CAN-Interface RKS+CAN
Diesel technology, engine technology, vehicle diagnostics, repair & maintenance.

Arduino mit MCP2515 als Steuerung

 
New Topic 🔒 Locked 🔗 🖨 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 mit MCP2515 als Steuerung Translating...

[Translating...]

Ich habe einen Arduino und ein MCP2515 und nutze diese Lib:
https://github.com/coryjfowler/MCP_CAN_lib
Ich kann auch Daten empfangen, nur wie vergleiche ich diese nun.
Angenommen es kommt die Nachricht ID=25A und Message=5,5,5,5,5,5,5,5.
Jetzt möchte ich irgendeinen Code ausführen.
Ich finde immer nur Beispiele um den internen Filter zu setzen.
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 mit MCP2515 als Steuerung Translating...

[Translating...]

Ich hab das Problem noch nicht so recht Verstanden. Du empfängst ein CAN Frame mit entsprechenden Daten und möchtest auf Basis dieser irgendwas tun ?

Ich gehe mal davon aus, das du die Daten richtig empfangen hast und zur weiteren Verwendung zwischenspeicherst. Dann kannst du die mit einer normalen Bedingung abfragen.

Beispiel:

if (Byte[0] = 0x01h)
{
tu was, wenn im ersten Byte der CAN Botschaft eine 1 steht ...
}
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 mit MCP2515 als Steuerung Translating...

[Translating...]

Bei C bitte mit Doppel =

if (Byte[0] == 0x01h)
{
tu was, wenn im ersten Byte der CAN Botschaft eine 1 steht ...
}
Back to top Profile PM
New Topic 🔒 Locked 🔗 🖨 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 Arduino + MCP2515 Werte aus Auto auslesen Microcontrollers and Electronics, Programming
No new posts Arduino + MCP2515 --> Signale "blockieren"? Microcontrollers and Electronics, Programming
No new posts VW MFD Steuerung Interior / Comfort CAN
Jump to:  
You cannot post new topics in this forum.