main + engine

Dependencies:   mbed

Engine.h

Committer:
yruiewyrui3
Date:
2016-06-01
Revision:
0:2294f5ee0610

File content as of revision 0:2294f5ee0610:

#ifndef ENGINE_H
#define ENGINE_H

#include "mbed.h"


class Engine{
  private:
    PwmOut _pwm;
    DigitalOut _fwd;
    DigitalOut _rev;
    
    float getPwm(float val);
    
  public:
    Engine(PinName pwm, PinName fwd, PinName rev): _pwm(pwm), _fwd(fwd), _rev(rev){}
    void move(int speed); // silniki pracuja z okreslona predkoscia (speed ma zakres od -1 do 1)
    void stop();    //hard stop
};


#endif