Diff: YMotorDriverSupplier.h
- Revision:
- 0:bb84da068c45
- Child:
- 1:9d8fe1f0ee36
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/YMotorDriverSupplier.h Sun Aug 23 15:17:57 2015 +0000 @@ -0,0 +1,34 @@ +#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