Diff: I2CMotor.h
- Revision:
- 1:46cf8d086b38
- Parent:
- 0:89910534fad4
- Child:
- 2:5b17e7dffb3d
--- a/I2CMotor.h Thu Jul 02 00:57:59 2015 +0000 +++ b/I2CMotor.h Fri Aug 21 04:51:31 2015 +0000 @@ -7,36 +7,36 @@ class I2CMotor : public I2CDevice{ public: enum ActionType{ + FORWARD, + REVERSE, + BRAKE, RELEASE, - LEFT, - RIGHT, - BRAKE }; - I2CMotor( I2C* i2c, char address ); + I2CMotor( char address ); void setActionType( ActionType action ){ mActionType = action; } void setDuty( float duty ){ - if ( duty > 1.0f ){ - duty = 1.0f; - } else if ( duty < 0.0f ){ - duty = 0.0f; + if ( duty > mMaxDuty ){ + duty = mMaxDuty; + } else if ( duty < mMinDuty ){ + duty = mMinDuty; } mDuty = duty; } - ActionType getActionType(){ + ActionType getActionType() const{ return mActionType; } - float getDuty(){ + float getDuty() const{ return mDuty; } - float getMaxDuty(){ + float getMaxDuty() const{ return mMaxDuty; } - float getMinDuty(){ + float getMinDuty() const{ return mMinDuty; }