Ok, went through totally separate implementation to see if 0xEB does all the magic thing, and using this - i would be able to code MOVE24, MOVEG6A and others.
Now, within ROBOBASIC in the beggining i do:
PTP SETON
PTP ALLON
'== motor diretion setting ======================
DIR G6A,1,0,0,1,0,0
DIR G6B,1,1,1,1,1,1
DIR G6C,0,0,0,0,0,0
DIR G6D,0,1,1,0,1,0
'== motor start position read ===================
GETMOTORSET G6A,1,1,1,1,1,0
GETMOTORSET G6B,1,1,1,0,0,0
GETMOTORSET G6C,1,1,1,0,0,0
GETMOTORSET G6D,1,1,1,1,1,0
SPEED 5
MOTOR G24
What is always to be used in my project.
As all my motors are on, and the speed is set - i would like to perform a movement of servoes 7,8 to position 0x64 - which stands for the 'middle'.
Here goes the code:
- Code: Select all
SerialPutc(hCom,0xEB);A=SerialGetc(hCom); //SYNC MOVE
SerialPutc(hCom,0x01);a=SerialGetc(hCom); //PTP
SerialPutc(hCom,0x07);b=SerialGetc(hCom); //Servo1
SerialPutc(hCom,0x08);c=SerialGetc(hCom); //Servo2
SerialPutc(hCom,0x64);d=SerialGetc(hCom); //Desire for Servo1
SerialPutc(hCom,0x64);e=SerialGetc(hCom); //Desire for Servo2
And what gets me dizzy here, is that on the 3rd/4th byte i put into controller values of the servos that i would like to setup.
Next two bytes are the desired positions for those two servos.
And,
compiling,
run..
And?
And the trouble is, that even if board echoes back (
SerialGetc(hCom);) the values correctly - robonova is NOT performing moves on the 7,8 servo - bot moves group A.
Now, due to the fact that i promised myself to code robonova1 with C, and that it is now more than just a project and slightly becomes a fight with myself - it is crucial for me to fix it up, and get this piece of servos running correctly.
Ok, so ideas:
- I think there should be some Sleep implemented, but the question is how often, how long ? Maybe after each sent character / received character i need to sleep for some ms ?
- If above is not the trick, then what? i am thinking of a command WAIT in robobasic - it has to WAIT for smth, for some bytes receieved from boards saying "Ok, i am ready to proceed futher ?" - is this a 0x00 byte sent via board?
Having all that in mind, i know that i am closer than futher - but there is still some piece missing...
i-Bot, pls..

Ok, went through totally separate implementation to see if 0xEB does all the magic thing, and using this - i would be able to code MOVE24, MOVEG6A and others.
Now, within ROBOBASIC in the beggining i do:
PTP SETON
PTP ALLON
'== motor diretion setting ======================
DIR G6A,1,0,0,1,0,0
DIR G6B,1,1,1,1,1,1
DIR G6C,0,0,0,0,0,0
DIR G6D,0,1,1,0,1,0
'== motor start position read ===================
GETMOTORSET G6A,1,1,1,1,1,0
GETMOTORSET G6B,1,1,1,0,0,0
GETMOTORSET G6C,1,1,1,0,0,0
GETMOTORSET G6D,1,1,1,1,1,0
SPEED 5
MOTOR G24
What is always to be used in my project.
As all my motors are on, and the speed is set - i would like to perform a movement of servoes 7,8 to position 0x64 - which stands for the 'middle'.
Here goes the code:
- Code: Select all
SerialPutc(hCom,0xEB);A=SerialGetc(hCom); //SYNC MOVE
SerialPutc(hCom,0x01);a=SerialGetc(hCom); //PTP
SerialPutc(hCom,0x07);b=SerialGetc(hCom); //Servo1
SerialPutc(hCom,0x08);c=SerialGetc(hCom); //Servo2
SerialPutc(hCom,0x64);d=SerialGetc(hCom); //Desire for Servo1
SerialPutc(hCom,0x64);e=SerialGetc(hCom); //Desire for Servo2
And what gets me dizzy here, is that on the 3rd/4th byte i put into controller values of the servos that i would like to setup.
Next two bytes are the desired positions for those two servos.
And,
compiling,
run..
And?
And the trouble is, that even if board echoes back (
SerialGetc(hCom);) the values correctly - robonova is NOT performing moves on the 7,8 servo - bot moves group A.
Now, due to the fact that i promised myself to code robonova1 with C, and that it is now more than just a project and slightly becomes a fight with myself - it is crucial for me to fix it up, and get this piece of servos running correctly.
Ok, so ideas:
- I think there should be some Sleep implemented, but the question is how often, how long ? Maybe after each sent character / received character i need to sleep for some ms ?
- If above is not the trick, then what? i am thinking of a command WAIT in robobasic - it has to WAIT for smth, for some bytes receieved from boards saying "Ok, i am ready to proceed futher ?" - is this a 0x00 byte sent via board?
Having all that in mind, i know that i am closer than futher - but there is still some piece missing...
i-Bot, pls..
