3A Motor Driver Shield

Talk about Arduino board, sheilds. Sharing Arduino projects, program, problems, solutions, suggestions..... many more, all are welcome.

3A Motor Driver Shield

Postby jakefrost309 » Sun Aug 19, 2018 11:41 pm

I would like to ask about some coding to control DC motors using 3A Motor Driver Shield

From the user manual,

DIR = direction
EN = PWM

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
delay(5000);

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

Can advice how to write the code for stopping the DC motor? Also, is this way of coding correct?
jakefrost309
Greenhorn
 
Posts: 2
Joined: Sun Aug 19, 2018 1:52 pm

Re: 3A Motor Driver Shield

Postby Idris » Mon Aug 20, 2018 9:00 am

Hi jakefrost309,

To stop, you can set the PWM to 0.

The coding seems correct, try to upload and see the result.
Cytron Technologies invest time and resources providing tutorial, training and support for STEM education and maker movement. We need your support by purchasing products from Cytron Technologies. Thanks.
http://www.cytron.com.my
User avatar
Idris
Moderator
 
Posts: 384
Joined: Thu Mar 22, 2012 5:28 pm
Location: Pulau Pinang

Re: 3A Motor Driver Shield

Postby jakefrost309 » Wed Aug 22, 2018 11:00 pm

Thanks Idris, it works. appreciate it. :)
jakefrost309
Greenhorn
 
Posts: 2
Joined: Sun Aug 19, 2018 1:52 pm


Return to Arduino Based

Who is online

Users browsing this forum: No registered users and 0 guests

cron