Yeah xan your right, I really don’t know much about this basic programming, mostly my knowledge is in vb i can usually grasp concepts pretty fast and learn them. but this code is pretty complicated, granted its layed out very well for people like myself to understand it.
I understand from previous pieces of code that I need to take the pulsin read of a channel and subtract 1500 and make that an absolute value so i only get positive numbers, then take that number and divide it by "some other number 2/4/8/16 whatever to make the output a number per say between 0 and 40 or so which would be MM movements. depending on which number i divde by will allow me to make my control movements either very precise or very large. … so reading a channel and doing something with the numbers isn’t difficult…
I guess its trying to understand the code I’m pretty sure that I have to disable a piece of the code so that i can feed the rest of the code the modified variables for individual leg control… I’m not looking for someone to flat out just post the program all done, but it seems like whatever i do the entire program breaks and no feature works.
…Ive been trying to compile for the last 4 hours and can’t seem to get it :\
::: Update
I’ve looked in the previous 2 pages of this post referencing the code posted and I’m missing something …
Ignore most of the crap above, I really have no idea why it works now, but this is all i did… and some history before this, when I did this before it did not compile at all and gave me weird errors although this works
[code] elseif LegMode
RFPosX = -(RCInput(1)-1500)/8
RFPosY = -(RCInput(3)-1500)/20
RFPosZ = (RCInput(0)-1500)/20
ENDIF
return [/code]
I’ll fiddle with this some now that its doing 'THINGS" other then just giving me the finger.
whoohoo
heh another update :::
Not quite what i was expecting although when i enter leg mode the leg is messed up even when I switch out of leg mode wacky! … and I know this because those individual variables I am messing with are defined at the beginning of the program out of the main loop.
I could enable a serial out to figure out what i need to divide the pulsin results with to get a max and min decimal output, and then figure out some way of returning the variables to the hard set values at the top of the program… come to think of it…
Could I just take this code
[code]'Feet Positions
RFPosX = 53 ;Start positions of the Right Front leg
RFPosY = 25
RFPosZ = -91
RMPosX = 105 ;Start positions of the Right Middle leg
RMPosY = 25
RMPosZ = 0
RRPosX = 53 ;Start positions of the Right Rear leg
RRPosY = 25
RRPosZ = 91
LFPosX = 53 ;Start positions of the Left Front leg
LFPosY = 25
LFPosZ = -91
LMPosX = 105 ;Start positions of the Left Middle leg
LMPosY = 25
LMPosZ = 0
LRPosX = 53 ;Start positions of the Left Rear leg
LRPosY = 25
LRPosZ = 91[/code]
and put it in a subroutine so I can call it again?
Put something like
legPositions: and at the bottom put Return
I think this will work to quickly reset the leg’s after you exit mode3: legcontrol mode… HRMS…
the gears are turning…