This library is for RS405CB controlled by RS-485
Revision 3:9311ea940978, committed 2019-12-12
- Comitter:
- FumiyaKoike
- Date:
- Thu Dec 12 04:44:10 2019 +0000
- Parent:
- 2:8ff319643fc3
- Commit message:
- Minor update;
Changed in this revision
| RS405CB.cpp | Show annotated file Show diff for this revision Revisions of this file |
| RS405CB.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/RS405CB.cpp Wed Dec 11 07:26:19 2019 +0000
+++ b/RS405CB.cpp Thu Dec 12 04:44:10 2019 +0000
@@ -68,48 +68,8 @@
/* -----------------------------------------------------------------------------
Arguments:
- ID ... 動かしたいサーボのID
- data ... 目標角.degreeの10倍の値を指定する.(ex 90° -> data = 900)
- speed... 移動時間の指定.10ms単位で指定(ex. 5000ms -> 500)
-
-Description:
-
------------------------------------------------------------------------------ */
-void RS405CB::GoalPosition(unsigned char ID, int data, int speed)
-{
- unsigned char TxData[12];
- unsigned char CheckSum = 0;
-
- TxData[0] = 0xFA;
- TxData[1] = 0xAF;
- TxData[2] = ID;
- TxData[3] = 0x00;
- TxData[4] = 0x1E;
- TxData[5] = 0x04;
- TxData[6] = 0x01;
- TxData[7] = (unsigned char)0x00FF & data;
- TxData[8] = (unsigned char)0x00FF & (data >> 8);
- TxData[9] = (unsigned char)0x00FF & speed;
- TxData[10] = (unsigned char)0x00FF & (speed >> 8);
-
- for(int i=2; i<=10; i++)
- {
- CheckSum = CheckSum ^ TxData[i];
- }
- TxData[11] = CheckSum;
-
- _permit = 1;
- for(int i=0; i<=11; i++) {
- putc(TxData[i]);
- }
- wait_us(810);
- _permit = 0;
-}
-
-/* -----------------------------------------------------------------------------
-Arguments:
ID ...
- speed ... 移動時間を10ms単位で指定
+ speed ... 移動時間を10ms単位で指定(ex 2000ms -> 200)
Description:
--- a/RS405CB.h Wed Dec 11 07:26:19 2019 +0000
+++ b/RS405CB.h Thu Dec 12 04:44:10 2019 +0000
@@ -8,7 +8,6 @@
// RS405CB SERVO COMMANDs
void Torque(unsigned char ID, unsigned char data);
void GoalPosition(unsigned char ID, int data);
- void GoalPosition(unsigned char ID, int data, int speed);
void SetSpeed(unsigned char ID, int speed);
void Change_ID(unsigned char oldID, unsigned char newID);
int Read_Deg(unsigned char ID);