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
Diff: KRS.h
- Revision:
- 1:50d0eb774b0d
- Parent:
- 0:7bf595a76895
- Child:
- 2:431a802d01e2
--- a/KRS.h Sat Jul 02 03:12:15 2022 +0000 +++ b/KRS.h Sun Jul 03 04:35:46 2022 +0000 @@ -5,14 +5,23 @@ 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: - uint8_t byteH, byteL; - uint16_t ins; - Serial _serial; };