Skip to content

How to structure CAN message for Simulink+Arduino to Tinymovr communication? #329

Answered by yconst
Gnorv asked this question in Q&A - Tinymovr
Discussion options

You must be logged in to vote

Please take a look here:

def ids_from_arbitration(arbitration_id):

These two functions pack and unpack node IDs, endpoint IDs and a hash value corresponding to the protocol version to and from CAN arbitration IDs that can be used in your messages. You will need to structure your arbitration IDs like this. For the protocol version, you can use zeros as a starting point, it is accepted.

With respect to the Data Field, it is always the first n bytes, and the size n is determined by the data type. For instance, an uint8 has a size of 1 byte. An IEEE754 float has a size of 4 bytes.

For messages that you send to re…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@Gnorv
Comment options

Answer selected by Gnorv
Comment options

You must be logged in to vote
1 reply
@Gnorv
Comment options

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