Shop OBEX P1 Docs P2 Docs Learn Events
push button problem — Parallax Forums

push button problem

Freqout_38kHzFreqout_38kHz Posts: 13
edited 2007-06-17 19:50 in General Discussion
i have 2 push button.·if ·i press 1st push button then servo goto 10'oclock, if ·i press·2nd push button then servo goto 2'oclock, if ·i not press·any push button then servo goto 12'oclock. Help me in SXB.
·

Comments

  • JonnyMacJonnyMac Posts: 8,943
    edited 2007-06-17 19:50
    I've attached a simple demo; it doesn't debounce the buttons and I have no idea if it meets your button connection or polarity requirements because you didn't state them, but it should get you started; update as required. Keep in mind that servos require a high-going pulse every 20 milliseconds or so. The program defines RB.0 as an output which will make that pin an output and low at startup so PULSOUT will work correctly with your servo.
Sign In or Register to comment.