7 #ifndef EV3CPPAPI_MOTOR_H_
8 #define EV3CPPAPI_MOTOR_H_
39 explicit Motor(
ePortM port,
bool brake =
true, motor_type_t type = LARGE_MOTOR);
57 ev3_motor_stop(mPort,
true);
58 ev3_motor_reset_counts(mPort);
67 inline int32_t
getCount(
void)
const {
return ev3_motor_get_counts(mPort) - mOffset; }
75 inline void setCount(int32_t count) { mOffset = ev3_motor_get_counts(mPort) - count; }
97 inline void stop() { (void)ev3_motor_stop(mPort, mBrake); }
105 inline motor_port_t
getPort(
void)
const {
return mPort; }
113 inline bool getBrake(
void)
const {
return mBrake; }
120 inline int getPWM(
void)
const {
return mPWM; }
131 #endif // ! EV3CPPAPI_MOTOR_H_
motor_port_t getPort(void) const
void setBrake(bool brake)
bool getBrake(void) const
void setCount(int32_t count)
Motor(ePortM port, bool brake=true, motor_type_t type=LARGE_MOTOR)
int32_t getCount(void) const