.

Dependencies:   HCSR04 Servo mbed

Committer:
yruiewyrui3
Date:
Tue Jun 21 07:46:37 2016 +0000
Revision:
1:b57f208d1d95
Parent:
0:5919ea7b3b90
.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
yruiewyrui3 0:5919ea7b3b90 1 #ifndef ENGINE_H
yruiewyrui3 0:5919ea7b3b90 2 #define ENGINE_H
yruiewyrui3 0:5919ea7b3b90 3
yruiewyrui3 0:5919ea7b3b90 4 #include "mbed.h"
yruiewyrui3 0:5919ea7b3b90 5
yruiewyrui3 0:5919ea7b3b90 6
yruiewyrui3 0:5919ea7b3b90 7 class Engine{
yruiewyrui3 0:5919ea7b3b90 8 private:
yruiewyrui3 0:5919ea7b3b90 9 PwmOut _pwm;
yruiewyrui3 0:5919ea7b3b90 10 DigitalOut _fwd;
yruiewyrui3 0:5919ea7b3b90 11 DigitalOut _rev;
yruiewyrui3 0:5919ea7b3b90 12
yruiewyrui3 0:5919ea7b3b90 13 float getPwm(float val);
yruiewyrui3 0:5919ea7b3b90 14
yruiewyrui3 0:5919ea7b3b90 15 public:
yruiewyrui3 0:5919ea7b3b90 16 Engine(PinName pwm, PinName fwd, PinName rev): _pwm(pwm), _fwd(fwd), _rev(rev){}
yruiewyrui3 0:5919ea7b3b90 17 void move(int speed); // silniki pracuja z okreslona predkoscia (speed ma zakres od -1 do 1)
yruiewyrui3 0:5919ea7b3b90 18 void stop(); //hard stop
yruiewyrui3 0:5919ea7b3b90 19 };
yruiewyrui3 0:5919ea7b3b90 20
yruiewyrui3 0:5919ea7b3b90 21
yruiewyrui3 0:5919ea7b3b90 22 #endif