H BRIDGE PARA MOTORES DC KL64Z
Dependencies: Motor mbed Servo
main.cpp@0:5f1b331ca523, 2014-07-18 (annotated)
- Committer:
- mderrant
- Date:
- Fri Jul 18 18:05:07 2014 +0000
- Revision:
- 0:5f1b331ca523
- Child:
- 1:6ee374b19aaf
H-BRIDGE MOTOR PARA KL46Z
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mderrant | 0:5f1b331ca523 | 1 | #include "mbed.h" |
mderrant | 0:5f1b331ca523 | 2 | #include "Motor.h" |
mderrant | 0:5f1b331ca523 | 3 | |
mderrant | 0:5f1b331ca523 | 4 | Motor m(PTA1, PTA2, PTD3); // pwm, fwd, rev |
mderrant | 0:5f1b331ca523 | 5 | |
mderrant | 0:5f1b331ca523 | 6 | int main() { |
mderrant | 0:5f1b331ca523 | 7 | for (float s= -1.0; s < 1.0 ; s += 0.01) { |
mderrant | 0:5f1b331ca523 | 8 | m.speed(s); |
mderrant | 0:5f1b331ca523 | 9 | wait(0.02); |
mderrant | 0:5f1b331ca523 | 10 | } |
mderrant | 0:5f1b331ca523 | 11 | } |