Dominik Święch
/
JakKrisowy_
.
Fork of JakKrisowy by
Engine.h@1:1e01b12063cd, 2016-07-14 (annotated)
- Committer:
- yruiewyrui3
- Date:
- Thu Jul 14 13:31:01 2016 +0000
- Revision:
- 1:1e01b12063cd
- Parent:
- 0:f3a3f80e3202
.;
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 |