Shop OBEX P1 Docs P2 Docs Learn Events
Method not working how expected — Parallax Forums

Method not working how expected

bboy8012bboy8012 Posts: 153
edited 2010-05-30 21:37 in Propeller 1
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.

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

Comments

  • MagIO2MagIO2 Posts: 2,243
    edited 2010-05-30 20:12
    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?
  • bboy8012bboy8012 Posts: 153
    edited 2010-05-30 21:37
    I was reading in the servo32v7 object you didnt have to, but I added servo.start, and it started to perfom as I expected.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sign In or Register to comment.