already have that!!!my dealine is approaching and despite your efforts i haven’t got near the solution.the problem is that i don’t have good knowledge of programming and i do not afford the time to learn it.i read in the manual v2_1 (page 162)that with the pulsout command you can change the polarity of the pulse.how can this be done?
This is school work George. You have to learn it. >.<
You have the code format down. You have the analog inputs working and you have the servos working. Have you tried to make changes to the math to see what would happen? It’s not likely you will break anything making changes to the program.
makepulses:
pulsout 10, pot1
pulsout 11, pot1
pulsout 12, pot3
return[/code] but i don’t know how to make pot2 have negative value and at the same time change the variables (ie.pot1)in the makepulses
Quick hints:
a) Don’t reuse the variables… that is maybe define pot1/pot2/pot3 to read in the pots… When calculating Pulse widths maybe define some new variables like PulseWidth1, PulseWidth2, PulseWidth3. So when you generate the pulses you are not overwriting the data you need to generate the next data…
Then you can do things like:
PulseWidth1 = (((pot1 + pot2)*2 + 1000) min PULSEWIDTHMIN) max PULSEWIDTHMAX
PulseWidth2 = ((pot1 - pot2)*2 + 1000) min … max…
Where the PULSEWIDTHMIN and PULSEWIDTHMAX are something you need to define that limit the range to something valid…
It goes without saying that you then should change the MakePulses to use the new variables.
b)goto start
buttona = in4
if buttona = 1 then start
gosub makepulses
start:
What is that supposed to do??? A bunch of code that can never execute?
You simply program the chip and test the results. You can do this over and over, very quickly. This is why it should be very easy to find the right code. It’s really very fast.