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

dear community,

i have an old motor and i want to test it with the Arduino Motor-Shield cf: Arduino Motor Shield Rev3 — Arduino Official Store

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

  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