Download Print this page

Arduino Uno Manual page 7

Motor driver shield
Hide thumbs Also See for Uno:

Advertisement

R = D3 – R could be used for Red on RGB LED
Buzzer
The buzzer is wired to D4. It is active HIGH
Reset Switch. The shield has a remote reset button located on it for easy access.
OUR EVALUATION RESULTS:
These shields are quite flexible and a significant step-up in versatility from the older L293 based modules,
albeit at a higher price. The weakest point is the L298P motor driver IC which limits the size of motors
that it can control, but if your requirements fall within its 2A per channel rating as most smaller robotic
vehicles do, this can be a nice option for putting together a robotic project. The header pins are quite long
and flexible. You will need to coax them into alignment as you insert the shield into the Arduino
board. Also note that the shield can sit down on the top of the USB connector of some boards. To avoid
any shorting concern, a little electrical or Kapton tape can be used to insulate the top of the connector.
The program below runs the DC motor control portion through an automated sequence of events.
Be sure to connect a valid motor voltage to the motor VMS screw terminal and connect one or more smaller
motors to the MotorA / MotorB screw terminals
L298P Motor Driver Shield Example Program
CODE:
* L298P Motor Shield
* Code for exercising the L298P Motor Control portion of the shield
* The low level motor control logic is kept in the function 'Motor'
*/
// The following pin designations are fixed by the shield
int const BUZZER = 4;
// Motor A
int const ENA = 10;
int const INA = 12;
// Motor B
int const ENB = 11;
int const INB = 13;
int const MIN_SPEED = 27; // Set to minimum PWM value that will make motors turn
int const ACCEL_DELAY = 50; // delay between steps when ramping motor speed up or down.
//==========================================================================
=====
// Initialization
//==========================================================================
=====
void setup()
{
pinMode(ENA, OUTPUT); // set all the motor control pins to outputs
pinMode(ENB, OUTPUT);
pinMode(INA, OUTPUT);
pinMode(INB, OUTPUT);
pinMode(BUZZER, OUTPUT);

Advertisement

loading
Need help?

Need help?

Do you have a question about the Uno and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Mega2650