PDA

View Full Version : Method not working how expected



bboy8012
05-31-2010, 03:35 AM
I have this method


Pri ControlESC | value
Debug.tx(16)
Debug.Str(String(13, "Calibrating Mamba25 ESC complete!"))
repeat
Debug.Str(String(13,"Enter a ESC value 1810 = Full throttle, 1479 = Nuetral/Full Brake, 1048 = Full reverse: "))
value := Debug.getDec
servo.set(escPin, value)
Debug.Str(String("You Entered: "))
Debug.Dec(value)

When I input a value in the PST the ESC doesnt respond, but the number comes up on the PST. Attached is the complete code.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

MagIO2
05-31-2010, 04:12 AM
Don't know enough about the Servo-object, but here are some thoughts that might help to find the problem by yourself.

Are you sure that it expects the pin number? Maybe it expects the bitmask.
Or ... are you sure that you use the right pin number? The numbers go from 0 to 31 and not from 1 to 32 as one might think. So, the last port-pin on the left side of a DIP-propeller is 15.

Don't you have to initialize the servo-object?

bboy8012
05-31-2010, 05:37 AM
I was reading in the servo32v7 object you didnt have to, but I added servo.start, and it started to perfom as I expected.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔