Class MotorL298 - GSTCH/SketchMadeEASY GitHub Wiki
Topic | Specification |
---|---|
Description | This class controls a rotating drive. The motor is controlled with a L298N H-bridge. This is able to control up to 2 motors. It uses a digital and a PWM pin to control one motor. The digital pin defines the direction, the PWM the speed. Create two objects of this class to control both motors. |
Constructor |
MotorL298(int DirectionPin, int SpeedPin) Parameter DirectionPin: Digital (Out) Pin SpeedPin: Digital (Out) Pin with PWM. |
Range | 0…255 |
Samples | MotorL298* motor = new MotorL298(12, 10); |
Examples |
05‐Motor fix speed, direction‐switch 06‐Motor variable speed, direction‐switch 07‐Motor variable speed, direction‐ and main‐switch 08‐Motor toggles between limit switches 09‐Motor toggles between limit switches, main switch 11-Two motors, one turns after the other 15-RemoteControl of a motor with an App |