Shop OBEX P1 Docs P2 Docs Learn Events
Membrane switch control — Parallax Forums

Membrane switch control

Blackbird455Blackbird455 Posts: 124
edited 2007-09-10 20:27 in BASIC Stamp
I am trying to find the best way to use momentary membrane switches to control a BS1.......

· Since you cannot interrupt a BS1(right?) , the push of the switch will not have any effect, until the end of a string of commands.
When I used a momentary switch on a BS2, I would have functions running out of an I/O, for about 900ms, and I would have to hold the switch for about a second until it would respond differently.

·My question is.........using two seperate BS1's........

· If I had BS1 #1 setup to "
IF ( in0 = 1 ) THEN
DO
high 15······ ' 15 would go to BS1 #2 and pull it high until it had time to cycle and respond
pause 2000
low 15
loop until···· ' whatever else I want it to do.........and so on......

Would this be the best way...........or am i missing something?



▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
ETERNAL NOOB, you could learn alot from a dummy.......

"one should not profess ones ignorance, one should just read more books"
······························································ ......unknown

Comments

  • D FaustD Faust Posts: 608
    edited 2007-09-08 22:33
    This doesn't solve the problem of response time, but you wouldn't have to hold the button down for that time period. That is the best I can think of, but you might be able to use a lacking relay or something like that instead of stamp #1.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    LOOKDOWN ThisThread, [noparse][[/noparse]Your_?, My_?, Cool_Thing], looknum
    LOOKUP looknum, [noparse][[/noparse]1, 2, 3], subnum
    ON subnum GOTO Hope_this_helps, Thanks!, WOW!!
    END 
    
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2007-09-08 23:15
    You could use a S-R Latch .... 4043B or 4044B

    http://www.tranzistoare.ro/datasheets/320/85522_DS.pdf

    Connect your switch so that it triggers the S (Set) In your program you just check the output as you normally would as if it were a button or switch directly connected to the pin, but immediately after you check it, send a signal to the R (Reset) pin to reset the IC.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2007-09-08 23:34
    You could also use a simple OR-Latch approach...

    By making the RESET pin an OUTPUT and LOW you reset the latch state.
    By making the RESET pin an INPUT you allow the switch to control the latch state.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
    767 x 663 - 99K
  • Blackbird455Blackbird455 Posts: 124
    edited 2007-09-10 20:27
    Thanks Beau,

    After researching your info, and weighing my options, I think that I will use two BS1's so that I have more available I/O's on BS#2.
    Plus......that means that I'll be buying more Stamps [noparse]:)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ETERNAL NOOB, you could learn alot from a dummy.......

    "one should not profess ones ignorance, one should just read more books"
    ······························································ ......unknown
Sign In or Register to comment.