Adafruit Motor Shield

Includes 4 H-Bridges using L293D chipset. Provides 0.6A per bridge (1.2A peak) with thermal shutdown protection, internal kickback protection diodes. Can run motors on 4.5VDC to 36VDC. Individual 8-bit speed selection.

Supposedly about a 1.2V drop across the L293D H-bridge.

Motor Shield kit instructions

Example

Hooked up to a toy RC truck with two motors. One motor controls the steering (left/right) and the other is the drive motor (forward/reverse). This example simply has the truck drive forward-right and then reverse-left.

Video: Arduino Motor Shield on Vimeo

#include <AFMotor.h>

AF_DCMotor drive(2, MOTOR12_1KHZ); // create motor #2, forward/reverse
AF_DCMotor steer(1, MOTOR12_1KHZ); // create motor #2, left/right

void setup() {
  Serial.begin(9600);           // set up Serial library at 9600 bps
  Serial.println("Motor test!");
  
  drive.setSpeed(200);     // set the speed to 200/255
  steer.setSpeed(200);     // set the speed to 200/255
}


void loop() {
  
  Serial.println("STEER RIGHT, DRIVE FORWARD");
  steer.run(FORWARD);
  drive.run(FORWARD);      
  delay(1000);
  
  Serial.println("RELEASE / STOP");
  drive.run(RELEASE);      
  steer.run(RELEASE);
  delay(5000);
  
  
  Serial.print("STEER LEFT, DRIVE BACKWARD");
  steer.run(BACKWARD);
  drive.run(BACKWARD);
  delay(1000);
  
  Serial.print("RELEASE / STOP");
  drive.run(RELEASE);
  steer.run(RELEASE);
  delay(5000);
}
motorshield.txt · Last modified: 2011/01/02 21:33 by john
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki