Solarbotics L298 driver and Sparkfun L298 driver
Supports the Solarbotics L298 motor driver and the similar Sparkfun L298 motor driver.
See http://www.solarbotics.com/assets/datasheets/solarbotics_l298_compact_motor_driver_kit.pdf for the datasheet.
Each motor requires an I/O pin which provides hardware PWM and two I/O pins to control the direction.
Since we are using hardware PWM then the pulses sent to the motors are very exact. This library can cope with any number of motors and so the only real limitation is the number of PWM channels that your micro controller provides. Each motor controller board can drive two motors.
The remaining two pins are the 'enable' pins. If the motor is turning the wrong way then you can either:
- swap over the two enable pins
- swap the leads going to the motor
- toggle the 'Inverted' option for the motor in Project Designer
- connect - Connect the actuator to the drive system.
- disconnect - Disconnect the actuator from the drive system. Once an actuator is disconnected it will stop responding to other commands until it is connected once again.
- getSpeed - Returns the value you specified in your previous call to setSpeed.
- isConnected - Test if an actuator is connected
- isInverted - Test if an actuator is inverted
- setConnected - Connect or disconnect the actuator from the drive system.
- setSpeed - Set the required speed to a value between DRIVE_SPEED_MIN and DRIVE_SPEED_MAX.