Shop OBEX P1 Docs P2 Docs Learn Events
Is there any code that is accessing the USER Button on the Spinneret? — Parallax Forums

Is there any code that is accessing the USER Button on the Spinneret?

Brandon_LBrandon_L Posts: 37
edited 2011-05-16 14:05 in Accessories
Is anyones code polling the USER button on the Spinneret Board?


Thanks

Brandon

Comments

  • David CarrierDavid Carrier Posts: 294
    edited 2011-05-13 15:25
    Brandon,
    The user button is on P23. It is active high, so ina[23] will read as a '1' while someone is pressing the button and a '0' while it is resting. You can also output to P23 to drive the user LED. You cannot drive the LED and read the button at the same time, but you can switch back and forth so fast that no one will notice:

    dira[23]~
    ButtonState := ina[23]
    dira[23]~~

    — David Carrier
    Parallax inc.
  • Brandon_LBrandon_L Posts: 37
    edited 2011-05-16 14:05
    David,

    Thanks so much! I will give that a shot.
Sign In or Register to comment.