Diff: I2CMotor.h
- Revision:
- 2:5b17e7dffb3d
- Parent:
- 1:46cf8d086b38
diff -r 46cf8d086b38 -r 5b17e7dffb3d I2CMotor.h --- a/I2CMotor.h Fri Aug 21 04:51:31 2015 +0000 +++ b/I2CMotor.h Wed Oct 14 03:50:35 2015 +0000 @@ -26,6 +26,9 @@ mDuty = duty; } + void setPercent( float p ){ + setDuty( p * mMaxDuty + ( 1.0f - p ) * mMinDuty ); + } ActionType getActionType() const{ return mActionType; } @@ -41,8 +44,7 @@ } protected: - virtual void write(); - virtual void read(){} + virtual int write(); private: ActionType mActionType; float mDuty;