Class library for a L298 H-Bridge
Dependents: inverted_pendulum_system
Fork of L298HBridge by
L298HBridge.cpp@0:39561fe6e4ff, 2017-01-19 (annotated)
- Committer:
- RiaanEhlers
- Date:
- Thu Jan 19 11:33:01 2017 +0000
- Revision:
- 0:39561fe6e4ff
- Child:
- 1:6d242bb216d6
v1.0
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
RiaanEhlers | 0:39561fe6e4ff | 1 | #include "L298HBridge.h" |
RiaanEhlers | 0:39561fe6e4ff | 2 | #include "mbed.h" |
RiaanEhlers | 0:39561fe6e4ff | 3 | |
RiaanEhlers | 0:39561fe6e4ff | 4 | |
RiaanEhlers | 0:39561fe6e4ff | 5 | L298HBridge::L298HBridge(PinName ENPin, PinName FWDPin, PinName REVPin) : _ENPin(ENPin), _FWDPin(FWDPin), _REVPin(REVPin) { |
RiaanEhlers | 0:39561fe6e4ff | 6 | _ENPin = 0; //PWM = 0% |
RiaanEhlers | 0:39561fe6e4ff | 7 | _FWDPin = 0; |
RiaanEhlers | 0:39561fe6e4ff | 8 | _REVPin = 0; |
RiaanEhlers | 0:39561fe6e4ff | 9 | } |
RiaanEhlers | 0:39561fe6e4ff | 10 | |
RiaanEhlers | 0:39561fe6e4ff | 11 | void L298HBridge::Fwd() { |
RiaanEhlers | 0:39561fe6e4ff | 12 | |
RiaanEhlers | 0:39561fe6e4ff | 13 | } |
RiaanEhlers | 0:39561fe6e4ff | 14 | |
RiaanEhlers | 0:39561fe6e4ff | 15 | void L298HBridge::Rev() { |
RiaanEhlers | 0:39561fe6e4ff | 16 | |
RiaanEhlers | 0:39561fe6e4ff | 17 | } |
RiaanEhlers | 0:39561fe6e4ff | 18 | |
RiaanEhlers | 0:39561fe6e4ff | 19 | void L298HBridge::Stop() { |
RiaanEhlers | 0:39561fe6e4ff | 20 | |
RiaanEhlers | 0:39561fe6e4ff | 21 | } |
RiaanEhlers | 0:39561fe6e4ff | 22 | |
RiaanEhlers | 0:39561fe6e4ff | 23 | void L298HBridge::Speed(int DutyPercent) { |
RiaanEhlers | 0:39561fe6e4ff | 24 | |
RiaanEhlers | 0:39561fe6e4ff | 25 | } |