![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
.
Engine.h@0:f3a3f80e3202, 2016-07-07 (annotated)
- Committer:
- yruiewyrui3
- Date:
- Thu Jul 07 12:56:54 2016 +0000
- Revision:
- 0:f3a3f80e3202
Jak Krisowy
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
yruiewyrui3 | 0:f3a3f80e3202 | 1 | #ifndef ENGINE_H |
yruiewyrui3 | 0:f3a3f80e3202 | 2 | #define ENGINE_H |
yruiewyrui3 | 0:f3a3f80e3202 | 3 | |
yruiewyrui3 | 0:f3a3f80e3202 | 4 | #include "mbed.h" |
yruiewyrui3 | 0:f3a3f80e3202 | 5 | |
yruiewyrui3 | 0:f3a3f80e3202 | 6 | |
yruiewyrui3 | 0:f3a3f80e3202 | 7 | class Engine{ |
yruiewyrui3 | 0:f3a3f80e3202 | 8 | private: |
yruiewyrui3 | 0:f3a3f80e3202 | 9 | PwmOut _pwm; |
yruiewyrui3 | 0:f3a3f80e3202 | 10 | DigitalOut _fwd; |
yruiewyrui3 | 0:f3a3f80e3202 | 11 | DigitalOut _rev; |
yruiewyrui3 | 0:f3a3f80e3202 | 12 | |
yruiewyrui3 | 0:f3a3f80e3202 | 13 | float getPwm(float val); |
yruiewyrui3 | 0:f3a3f80e3202 | 14 | |
yruiewyrui3 | 0:f3a3f80e3202 | 15 | public: |
yruiewyrui3 | 0:f3a3f80e3202 | 16 | Engine(PinName pwm, PinName fwd, PinName rev): _pwm(pwm), _fwd(fwd), _rev(rev){} |
yruiewyrui3 | 0:f3a3f80e3202 | 17 | void move(int speed); // silniki pracuja z okreslona predkoscia (speed ma zakres od -1 do 1) |
yruiewyrui3 | 0:f3a3f80e3202 | 18 | void stop(); //hard stop |
yruiewyrui3 | 0:f3a3f80e3202 | 19 | }; |
yruiewyrui3 | 0:f3a3f80e3202 | 20 | |
yruiewyrui3 | 0:f3a3f80e3202 | 21 | |
yruiewyrui3 | 0:f3a3f80e3202 | 22 | #endif |