3) Select UPLOAD to program the sketch on the UNO Board.
4) Unplug the USB cable, then power the board with 7-12V battery
pack.
Code 1:
int AIN1=2;
int AIN2=3;
int STBY=4;
int BIN1=5;
int BIN2=6;
int PWMA=10;// enable pin 1
int PWMB=11;// enable pin 2
// D2 and D3 as a set, D5 and D6 as a set
// D10 and D11 as enable pins for DC motors
void setup()
{
int i;
for (i=2;i<=6;i++) // Ardunio motor driver module
pinMode(i,OUTPUT); // set digital pins 2,3,4,5,6 as output
pinMode(10,OUTPUT);// set digital pins 10, 11 as output
pinMode(11,OUTPUT);
}
240