-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Labels
Description
class Motor
{
public:
static const S8 PWM_MAX = 100;
static const S8 PWM_MIN = -100;
explicit Motor(ePortM port, bool brake = true);
~Motor(void);
inline void reset(void)
{
nxt_motor_set_speed(mPort, 0, 1); // need to set brake to stop the motor immidiately
nxt_motor_set_count(mPort, 0);
}
inline S32 getCount(void) const { return nxt_motor_get_count(mPort); }
inline void setCount(S32 count) { nxt_motor_set_count(mPort, count); }
void setPWM(S8 pwm);
void setBrake(bool brake);
protected:
inline ePortM getPort(void) const { return mPort; }
inline bool getBrake(void) const { return mBrake; }
inline S8 getPWM(void) const { return mPWM; }
private:
ePortM mPort;
bool mBrake;
S8 mPWM;
};When the above is reversed, a parameter of void is made but isn't wonderful as follows.
The expectation value.
There is this source cord in the following.
Source cord above-mentioned
nxtOSEK_v218/nxtOSEK/ecrobot/c++/device/Motor.h
https://dev.change-vision.com/projects/jude/ticket/6363 (private URL)

