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

push button stearing?

Jayguy5000Jayguy5000 Posts: 139
edited 2005-07-18 21:07 in BASIC Stamp
i currently have 2 push buttons atop the breadboard on my lovely boe bot. So far the two buttons can turn right left and when both pressed it goes forward! but the hang up is making it go backwards as well with only 2 buttons. Im sure one of you smart fellers out there can figure something out for me smilewinkgrin.gif

Comments

  • Bruce BatesBruce Bates Posts: 3,045
    edited 2005-07-17 02:42
    JayGuy5000 -

    Does a small and inexpensive, but durable surplus joystick like that below appeal to you?
    http://www.aaaim.com/u/web/aaaimc/cgi-local/shop991/shop.pl/SID=854235937/page=MISC.htm#JS9850

    Just one thought that can probably be implemented easily with the RCTIME instruction, or by using a couple of ADCs.

    Regards,

    Bruce Bates
  • KenMKenM Posts: 657
    edited 2005-07-17 02:43
    With two buttons, at a minimum you can have 4 distnct operations.

    b1 b2 action

    0·· 0· left

    0·· 1· right

    1·· 0· reverse

    1·· 1· other

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Ken
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-07-18 17:30
    Ken hit the nail on the head, there are 4 total possible combinations of two buttons, though I would define the motions as such (1 is pressed button, 0 not pressed, switch these two if you have an active low setup for your button)

    0· 0· forward

    1· 0· left

    0· 1· right

    1· 1· reverse

    left button controls·left servo, and right button controls right servo.·If button is 0, servo is full forward, if button is 1, servo is in full reverse. This setup will cause your turns to be the "pivot in place" type since one servo will be going forwards while the other is spinning in reverse. You'll also note there is no unused·combination of buttons availible to represent a "stop".


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·1+1=10
  • AmaralAmaral Posts: 176
    edited 2005-07-18 21:07
    You can use “two clicks” on each on of then , this will increase your possibilities to at least 6 ( may no not be possible to reach 1 1 at the same time , { I mean , it could be very hard to achieve } ) .

    But this way , you could change for:

    Two clicks left = go left
    Two clicks right = go right
    One click left OR right = go forward ´ note that you will be using two commands here could be just one
    Two buttons clicked together = go back
    Two buttons left without click = stop

    5 operations . it’s all you need.

    Ricardo Amaral
Sign In or Register to comment.