• Sign in to Neowin Faster!

    Create an account on Neowin to contribute and support the site.

  • 0
Sign in to follow this  

simple- Arduino-motor-control with Arduino r3 - and a Arduino Motor Shield 


tarifa    0

dear community, 


i have an old motor and i want to test it with the Arduino Motor-Shield  cf: https://store.arduino.cc/arduino-motor-shield-rev3

question: is there any library for the Arduino-Motor-board.


what is aimed; i want to run two DC motors.


First of all: i need to have a basic-setup with that the whole thing works.  So let us assuming that the motor is a simple dc motor, then we can simply control it by interfacing a external H-bridge driver (IC)   to the Arduino or i can simply go with L298P motor controller which has the same driver on board.

some methodological prliminaries: PWM is - i guess - easier to control in a digital environment:  the efficiency of PWM is way better than and approach of voltage regulation.


the learing-curve: what i have learned allready: i have put some ideas and thougths togehter of what i have learned here (and there) while reading older postings in this forums; 

Note: this is a overwhelming place of knowledge sharing and idea exchange. I am so happy to be here in this great and overwhelming forum. 

So back to the above mentioned issue: i need to get the old motor up and runing - but i guess that first i have to set the basics: 

Both motor’s current readings are sent over the serial-connection. I want to see the current readings be seen with the serial monitor. 


Question: is this doable! Well i guess that i do not need a complete library for doing that: - i think that i can go with the code like so: 


void setup() {

  //Setup Channel A
  pinMode(12, OUTPUT); //Initiates Motor Channel A pin
  pinMode(9, OUTPUT); //Initiates Brake Channel A pin


void loop(){

  //forward @ full speed
  digitalWrite(12, HIGH); //Establishes forward direction of Channel A
  digitalWrite(9, LOW);   //Disengage the Brake for Channel A
  analogWrite(3, 255);   //Spins the motor on Channel A at full speed


  digitalWrite(9, HIGH); //Engage the Brake for Channel A


what do you say - should there be some changes / methodological corrections in the above outline!?


love to hear from you 



Share this post

Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.