Driver for two motors library

Driver.h

Committer:
cristian_junca
Date:
2020-07-28
Revision:
0:eafb70ae80f7
Child:
1:e417951c16d7

File content as of revision 0:eafb70ae80f7:

#include "mbed.h"

class driver{
    
    public:  
        driver(PinName M1A, PinName M1B, PinName M2A, PinName M2B);
        void setPeriod_ms(int32_t);
        void forward(float, float);
        void backward(float, float);
        void right(float, float);
        void left(float, float);
        void neutral();
        
    protected:
        PwmOut M1A;
        PwmOut M1B;
        PwmOut M2A;
        PwmOut M2B;
        float _dutyCycle1;
        float _dutyCycle2;
        int32_t _period;
};