And I missed what Xan mentioned in the other thread and that is to get rid of the extra #
Kurt
And I missed what Xan mentioned in the other thread and that is to get rid of the extra #
Kurt
i have tried all 3 codes but all im getting back are twitching servos when i call up the sub.
i have tried the bytetable and the other simple serout commands.
also what is the swServoVal doing?
thanks again.
Do you call it just once or do you repeat calling it? I sometimes found if you continuously output new commands to the SSc-32 without giving it time, it can cause my servos to twitch… You should only need to call it once.
swServoVal is not needed, it was a quick cut and paste and I did not completely check these all out…
I assume you have already ruled out power issues. IE when you tell all of the servos to move to 1500, could it be that either the SSC-32 or the Atom may have reset…
Kurt
“swServoVal” yeah thought so. id already taken it out anyway.
the power is fine. all other functions work!
i have changes a few words but all still should work as explained.!
Here is what i have:
Constants:
ServoINDEX con 13
Byte table
AllServos bytetable RRCoxaPin, RRFemurPin, RRTibiaPin, RFCoxaPin, RFFemurPin, RFTibiaPin, LRCoxaPin, LRFemurPin, LRTibiaPin, LFCoxaPin, LFFemurPin, LFTibiaPin, HeadPin
Variable
Center var byte
DualshockIF (DualShock(2).bit6 = 0) and LastButton(1).bit6 THEN ;Cross Button test
GOSUB ALL1500
ENDIF
Sub
ALL1500
for Center = 0 to ServoINDEX
serout SSC_OUTPUT,SSC_BAUD,"#",DEC AllServos(Center),"P1500"]
next
serout SSC_OUTPUT,SSC_BAUD,"T200",13]
return
is the prob in dualshock?
whats the best place to add byte table or doesnt it matter?
For the fun of it, if you don’t already have it, I would put in a sound at the start of the program to make sure something does not reset…
Also there may be a slight bug in what I hacked up on the for loop. That is, you should only loop the number of servos times, but as our table is 0 based, you may need to change the for loop to be:
for Center = 0 to ServoINDEX-1
Kurt
For the fun of it, if you don’t already have it, I would put in a sound at the start of the program to make sure something does not reset…
Also there may be a slight bug in what I hacked up on the for loop. That is, you should only loop the number of servos times, but as our table is 0 based, you may need to change the for loop to be:
for Center = 0 to ServoINDEX-1
Kurt
some very good ideas there.
added the -1 and sound.
it beeps or plays the tune i programmed… nothing special, not worth playing at my next gig anyway. LOL…
…but still no joy. still twitching! would it be worth adding:
goto ALL1500
As I have not seen your full code, I am not sure what happens after this…
That is, suppose for example that you press the cross button and your code is called to position all of the servos to 1500. Now what happens. Does your code jump back up to the PS2 to get the next input and since no new button is pressed does it then do the standard and fall through and call the standard XYZ positioning and then output new servo positions?
If so you need to change the code to work more like how the phoenix process the start button. That is it turns on a global variable HexOn which toggles when the user presses the start button. So you may need to change your code that when the Cross button is pressed , you check to see if a variable: lets call it something like: Quad1500Mode. If it is off, you turn it on and call your 1500 function. If it was on, you then turn it off. Then in the main loop if this variable is set, you do not call the ServoDriver…
I hope this makes sense.
Kurt
As I have not seen your full code, I am not sure what happens after this…
That is, suppose for example that you press the cross button and your code is called to position all of the servos to 1500. Now what happens. Does your code jump back up to the PS2 to get the next input and since no new button is pressed does it then do the standard and fall through and call the standard XYZ positioning and then output new servo positions?
spot on. i feel this may be why.
If so you need to change the code to work more like how the phoenix process the start button. That is it turns on a global variable HexOn which toggles when the user presses the start button. So you may need to change your code that when the Cross button is pressed , you check to see if a variable: lets call it something like: Quad1500Mode. If it is off, you turn it on and call your 1500 function. If it was on, you then turn it off. Then in the main loop if this variable is set, you do not call the ServoDriver…
I hope this makes sense.
Kurt
makes perfect sence. im actually running the phoenix code so this is very clear to me now.
ill have a look though it soon and see how i can “bipass” these.
thanks