MDDS30 Serial Packet Control

Autonomous Robot, Manual Robot, DC Motor Driver, Stepper Motor Driver, Servo, Multi PWM chip.....

MDDS30 Serial Packet Control

Postby drannex42 » Sun Dec 06, 2020 2:26 pm

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!
drannex42
Freshie
 
Posts: 5
Joined: Sun Dec 06, 2020 2:21 pm

Re: MDDS30 Serial Packet Control

Postby drannex42 » Sun Dec 06, 2020 4:24 pm

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
drannex42
Freshie
 
Posts: 5
Joined: Sun Dec 06, 2020 2:21 pm

Re: MDDS30 Serial Packet Control

Postby waiweng83 » Mon Dec 07, 2020 2:23 pm

Sorry for replying late.
It's great to hear that you have got it sorted out.

Thanks.
With the power of dream, nothing is impossible...
User avatar
waiweng83
Moderator
 
Posts: 189
Joined: Wed Apr 15, 2009 2:17 pm


Return to Robot Controller

Who is online

Users browsing this forum: No registered users and 1 guest

cron