YMotorDriverSupplier.h

Committer:
inst
Date:
2015-08-23
Revision:
0:bb84da068c45
Child:
1:9d8fe1f0ee36

File content as of revision 0:bb84da068c45:

#ifndef INCLUDED_YMOTOR_DRIVER_SUPPLIER_H
#define INCLUDED_YMOTOR_DRIVER_SUPPLIER_H

#include "mbed.h"
#include "YMotorDriverBase.h"

class YMotorDriverSupplier : public YMotorDriverBase{
public:
    enum DinID{
        LAZER,
        PHOTOINTERRUPTER
    };

    YMotorDriverSupplier( char address );
    virtual void update();
private:
    void updateSupplier();
    void itr();

    static const float mDuty;
    static const PinName mDinPinName[];
    static const float mTimeout_sec;
    
    DigitalIn* mLazerDin;
    InterruptIn* mPhotointerrupter;
    Timer* mTimer;
    bool mIsWorking;
    bool mIsMayStoppable;
    bool mPrevInterrupterState;
    bool mHasFinished;
    Timer* mLazerTimer;
};

#endif