Page 1 of 1

3A Motor Driver Shield

PostPosted: Sun Aug 19, 2018 11:41 pm
by jakefrost309
I would like to ask about some coding to control DC motors using 3A Motor Driver Shield

From the user manual,

DIR = direction

Hence, lets say if i want to control the speed of the motor 100 pwm CW(5s), stop(5s), 100pwm CCW(5s), how do i code?;

is this correct?

digitalWrite(en1, 100);
digitalWrite(dir, HIGH); //this is for CW direction

digitalWrite(en1, 100);
digitalWrite(dir, LOW); //this is for CCW direction

Can advice how to write the code for stopping the DC motor? Also, is this way of coding correct?

Re: 3A Motor Driver Shield

PostPosted: Mon Aug 20, 2018 9:00 am
by Idris
Hi jakefrost309,

To stop, you can set the PWM to 0.

The coding seems correct, try to upload and see the result.

Re: 3A Motor Driver Shield

PostPosted: Wed Aug 22, 2018 11:00 pm
by jakefrost309
Thanks Idris, it works. appreciate it. :)