Simple- Arduino-Motor-Control With Arduino R3 / Motor Shield

Einfach Dinge, die nichts mit XAMPP, Apache Friends, Apache, MySQL, PHP und alle dem zu tun haben. Allerlei halt. ;)

Simple- Arduino-Motor-Control With Arduino R3 / Motor Shield

Postby unleash_it » 23. October 2019 04:49

dear community, good day dear Nobbie



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 forum and on other placesl....

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: 


Code: Select all
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

  delay(3000);

  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 
unleash_it
 
Posts: 48
Joined: 10. December 2011 18:32
Operating System: linux opensuse 12.1

Return to Allerlei

Who is online

Users browsing this forum: No registered users and 0 guests