KRS ICSサーボモータ用ライブラリ
初期化 KRS name(tx,rx);
位置指定 void SetPosition(id, position); [position : 0 3500 ~ 11500]
速度設定 void SetSpeed(id, speed); [speed : 0 ~ 127]
ストレッチ設定 void SetStretch(id, stretch); [stretch : 0 ~ 127]
電流制限設定 void SetCurrent(id, rotate, value : 0 ~ 127); [rotate : KRS::F KRS::R KRS::COM, current : 0 ~ 64]
ID書き込み void WriteAddress(id);
id : 0x00 ~ 0x1F
KRS.h
- Committer:
- koki_konishi
- Date:
- 2022-07-03
- Revision:
- 1:50d0eb774b0d
- Parent:
- 0:7bf595a76895
- Child:
- 2:431a802d01e2
File content as of revision 1:50d0eb774b0d:
#ifndef MBED_KRS_H #define MBED_KRS_H #include "mbed.h" class KRS{ public: typedef enum ROTATE { F, R, COM } ROTATE; KRS(PinName tx,PinName rx); void KRS::SetStretch(uint8_t address, uint8_t value); void KRS::SetSpeed(uint8_t address, uint8_t value); void KRS::SetCurrent(uint8_t address, ROTATE rotate, uint8_t value); void KRS::SetPosition(uint8_t address, uint16_t value); private: Serial _serial; }; #endif