Shop OBEX P1 Docs P2 Docs Learn Events
Code for Resetting PSC — Parallax Forums

Code for Resetting PSC

LexLex Posts: 13
edited 2009-03-25 16:34 in BASIC Stamp
I'm trying to use 2 switches to position my servos via the PSC.

When a change in switch status occurs, the servos does not respond. They will only move after I've pressed the reset button on the PSC.

Is there any code that I can use to reset the PSC withotu manually resetting it?

Comments

  • Adrian SchneiderAdrian Schneider Posts: 92
    edited 2009-03-23 07:53
    your main program should end with
    GOTO Main
    

    not with
    RETURN
    

    .
  • LexLex Posts: 13
    edited 2009-03-24 14:12
    I've checked, it works the same with either "RETURN" or "GOTO MAIN"

    there's a soft buzzing sound coming from the PSC when it's not responding. the green indicator is ON, meaning that comms is good.
    Either a manual reset or re-inserting the +5V in to the breadboard will do the trick. The thing is I'm trying to use RF to send in the signals.

    I'm thinking of using transistor to control the +5V signal. Any ideas?
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2009-03-25 16:29
    Looking at your code it seems the PSC is getting multiple commands right in a row with no delays to allow anything to happen. It’s no wonder you’re getting the buzzing since as soon as you tell it to go to one position it immediately gets a new position and so on. You need to give the servos time to reach their new positions before sending new commands.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • ZootZoot Posts: 2,227
    edited 2009-03-25 16:34
    Remember that you can poll (query) the PSC to find out where the servo pulse actually is (depending on ramp speed, position, etc) to determine if the servo has theoretically reached the position you commanded it to go to. See the documentation for info on servo position reporting.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST

    1uffakind.com/robots/povBitMapBuilder.php
    1uffakind.com/robots/resistorLadder.php
Sign In or Register to comment.