Servo32_Demo Object questions
Paul K.
Posts: 150
I've been playing around with this program and trying to figure this out.
Below is a portion of the·object that·I dont know how to accomplish what I need it to do.·
'Pan selected DEMO servo3 & 4 back-n-forth opposite of each other
···· repeat temp from 1000 to 2000
····· waitcnt (cnt+125_000)
····· SERVO.Set(PanServo3,temp)
····· SERVO.Set(PanServo4,3000-temp)
···· repeat temp from 2000 to 1000
····· waitcnt (cnt+125_000)
····· SERVO.Set(PanServo3,temp)
····· SERVO.Set(PanServo4,3000-temp)
How·can this be·modified·to control two servos with different temp values.
For example I need servo 3 to travel from 1500 to 2000 and servo 4 to travel from 1000 to 1500.
I can do it where each moves but I cant get them to move at the same time.·
Is this even possible.
Thanks
Paul
Below is a portion of the·object that·I dont know how to accomplish what I need it to do.·
'Pan selected DEMO servo3 & 4 back-n-forth opposite of each other
···· repeat temp from 1000 to 2000
····· waitcnt (cnt+125_000)
····· SERVO.Set(PanServo3,temp)
····· SERVO.Set(PanServo4,3000-temp)
···· repeat temp from 2000 to 1000
····· waitcnt (cnt+125_000)
····· SERVO.Set(PanServo3,temp)
····· SERVO.Set(PanServo4,3000-temp)
How·can this be·modified·to control two servos with different temp values.
For example I need servo 3 to travel from 1500 to 2000 and servo 4 to travel from 1000 to 1500.
I can do it where each moves but I cant get them to move at the same time.·
Is this even possible.
Thanks
Paul
Comments
Try this....
Servos move in same direction:
Servos move in opposite·direction:
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
I understand your two examples.· My example that I gave was actually a bad one.
What I meant is something like this
Servo1 needs to move from 1200 to 1500
Servo2 needs to move from 1000 to 1800
This is more of what I was trying to ask in the first post.
Subtracting or adding to temp dosent quite work.· Unless I'm missing something.
is there another way of coding the repeat so multipule values can be instereted only directed to
either one of the servos.
Hope this makes sense
Paul
Post Edited (Paul K.) : 10/10/2007 6:42:23 PM GMT
This is just math trivia... What you need to do is determine a common reference denominator that
represents the passage of time from point A to point B.· This can be any arbitrary value.· Typically,
I use 0 to 100 as a percentage, but because we want a decent resolution we might use something
more like 0 to 1000.· So we setup the subroutine like this....
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Post Edited (Beau Schwabe (Parallax)) : 10/11/2007 1:54:38 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Stan Dobrowski