Page 1 of 1

cytron smartdriver duo library

PostPosted: Fri Sep 07, 2018 5:20 pm
by izhar
Hye,

i am trying to learn to program with cytron_smartdriverduo.h . i have a project to control 4 DC motors independently by using 2 x MDDS30 connected to a base shield v2. i have looked into the sample programming provided 'MDDSPWMTEST' that show the coding to control 2 motors as follows;

CODE: SELECT_ALL_CODE
#include <Cytron_SmartDriveDuo.h>
#define IN1 4 // Arduino pin 4 is connected to MDDS30 pin IN1.
#define AN1 6 // Arduino pin 6 is connected to MDDS30 pin AN1.
#define AN2 5 // Arduino pin 5 is connected to MDDS30 pin AN2.
#define IN2 3 // Arduino pin 3 is connected to MDDS30 pin IN2.
Cytron_SmartDriveDuo smartDriveDuo30(PWM_INDEPENDENT, IN1, IN2, AN1, AN2);


may i know how do i add a code for an additional 2 motors to the program? i have simply tried adding #define IN3,IN4,AN3 and AN4. but it does'nt work.

you help is much appreciated.

Thank you

Re: cytron smartdriver duo library

PostPosted: Tue Sep 18, 2018 12:17 pm
by ZaM
HI,

You also can use another Motor Driver sample code to control your MDDS, for example, use this MD10C example code, choose Sign Magnitude example. The link is example to control motor using Potentiometer as speed input.

You just need to add 3 more PWM and DIR pin, and set your MDDS with PWM input mode with microcontroller (Independent Both)

Link: https://github.com/CytronTechnologies/A ... ag_Pot.ino