EV3RT C++ API Reference  Version 1.0
An RTOS-based development platform for LEGO Mindstorms EV3.
Motor クラス

#include <Motor.h>

公開メンバ関数

 Motor (ePortM port, bool brake=true, motor_type_t type=LARGE_MOTOR)
 
 ~Motor (void)
 
void reset (void)
 
int32_t getCount (void) const
 
void setCount (int32_t count)
 
void setPWM (int pwm)
 
void setBrake (bool brake)
 
void stop ()
 

静的公開変数類

static const int PWM_MAX = 100
 
static const int PWM_MIN = -100
 

限定公開メンバ関数

motor_port_t getPort (void) const
 
bool getBrake (void) const
 
int getPWM (void) const
 

フレンド

class Steering
 

詳解

EV3 モータクラス

構築子と解体子

◆ Motor()

Motor ( ePortM  port,
bool  brake = true,
motor_type_t  type = LARGE_MOTOR 
)
explicit

コンストラクタ

引数
portモータポート番号
braketrue:ブレーキモード/false:フロートモード
typeモータタイプ
戻り値
-

◆ ~Motor()

~Motor ( void  )

デストラクタ
モータを停止する

引数
-
戻り値
-

関数詳解

◆ getBrake()

bool getBrake ( void  ) const
inlineprotected

ブレーキ設定取得

引数
-
戻り値
trueブレーキモード
falseフロートモード

◆ getCount()

int32_t getCount ( void  ) const
inline

オフセット付き角位置取得

引数
-
戻り値
モータ角位置 [deg]

◆ getPort()

motor_port_t getPort ( void  ) const
inlineprotected

モータ接続ポート取得

引数
-
戻り値
モータ接続ポート

◆ getPWM()

int getPWM ( void  ) const
inlineprotected

PWM設定値取得

引数
-
戻り値
PWM設定値

◆ reset()

void reset ( void  )
inline

モータリセット
モータ停止および角位置の0リセット、オフセット初期化を行う

引数
-
戻り値
-

◆ setBrake()

void setBrake ( bool  brake)

ブレーキモード設定

引数
braketrue:ブレーキモード/false:フロートモード
戻り値
-

◆ setCount()

void setCount ( int32_t  count)
inline

角位置設定
現在のモータ角位置と設定角位置との差分をオフセットとして設定する

引数
countモータ角位置 [deg]
戻り値
-

◆ setPWM()

void setPWM ( int  pwm)

モータPWM値設定
ブレーキモードでPWM値が0の場合、モータを停止する

引数
pwmPWM値 (-100 - 100)
戻り値
-

◆ stop()

void stop ( )
inline

停止する。

引数
-
戻り値
-

フィールド詳解

◆ PWM_MAX

const int PWM_MAX = 100
static

PWM最大値

◆ PWM_MIN

const int PWM_MIN = -100
static

PWM最小値


このクラス詳解は次のファイルから抽出されました: