Page 1 of 1

MDDS30 Serial Packet Control

PostPosted: Sun Dec 06, 2020 2:26 pm
by drannex42
Hello,

I am writing the drivers needed in C, I have been able to communicate and control the motors, but I am having a slight problem.

In Packetized Serial I need to set an address byte (address location (mine is 0)) and then follow it with another command to control either the left or right motors (a 1 or 0).

What would this address byte look like? Would it be something similar to 00010000, or something similar? I am a fair bit confused and have tried a thousand different variations. Thanks.

P.S. I looked at the Arduino sample code, and it appears the sample code doesn't control the right motor independently (only the left), but this is just me pouring over the code without trying it. I just need to figure out how to send data to the left and right motors with the right address byte!

Re: MDDS30 Serial Packet Control

PostPosted: Sun Dec 06, 2020 4:24 pm
by drannex42
I have been working on this problem all day, and right as I was about to head to bed I came to the solution.

If your Address is 0, and you want to control the left motor send "0" if you want to control the right motor send "8" or "1000". This will solve anyone else's problem in the future. Be sure they are unsigned (or signed) ints!

If you have a different address, then the code will 0111 or 1111 (CHANNEL BIT (1 or 0) + ADDRESS BIT (3 Digits)) you can distill this downwards to the proper decimal (1000 is 8) as well if you would prefer/need.

------------------
t. Macleod Sawyer

Re: MDDS30 Serial Packet Control

PostPosted: Mon Dec 07, 2020 2:23 pm
by waiweng83
Sorry for replying late.
It's great to hear that you have got it sorted out.

Thanks.