I want to input position data to a motor in hexadecimal the data should be distributed among data 4,5,6 each containing 2 digits


with the least significant bit in 4
and upwards I have the data as a single variables

for example in order to get 360 degree motion it corresponds to 34bc0

I have characters that contain these values i.e. xxx=3 , xxxx=4 xxxxx=b and so on

Posting images of snippets of code is sub-optimal. Please read the forum guidelines to see how to properly post code and some information on making a good post.

Use the IDE autoformat tool (ctrl-t or Tools, Auto format) before posting code in code tags.

Please go back and fix your original post

Generally we want to see the whole code so that we know variable data types, libraries used, objects declared and such.

1 Like

Also, you will have to do a better job of describing your problem. I realize that your first language might not be English, but that realization is of not much use in understanding you.

so 0x34bc0 = 360 * (216000 / 360) = 360 * 600

why scale the value in degrees by 600?
360 in hex is 0x168

looks like you're trying to send the value in a CAN message. what is the message and its format?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.