Shop OBEX P1 Docs P2 Docs Learn Events
spst switch as input device — Parallax Forums

spst switch as input device

ArchiverArchiver Posts: 46,084
edited 2003-06-02 15:13 in General Discussion
Hi,
I am very new to stamps, so please excuse my ignorance. I am
building a kinetic sculpture, and want to use a SPST switch as an
input device. Can this be done??

Thanks

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2003-06-01 19:39
    Yes:


    V++
    -+-
    | /
    +
    O O----+
    > Input Pin
    |
    \
    /
    \ 10k
    /
    |
    V


    When the switch is open, the input pin will read 0.
    When the switch is closed, the input pin will read 1.




    --- In basicstamps@yahoogroups.com, "kailip" <lou@u...> wrote:
    > Hi,
    > I am very new to stamps, so please excuse my ignorance. I am
    > building a kinetic sculpture, and want to use a SPST switch as an
    > input device. Can this be done??
    >
    > Thanks
  • ArchiverArchiver Posts: 46,084
    edited 2003-06-01 19:41
    Sorry about that, the browsers doesn't display my ASCII art properly.
    I'll try again

    <tt>
    V++
    -+-
    | /
    +
    O O----+
    > Input Pin
    |
    \
    /
    \ 10k
    /
    |
    V

    </tt>


    > When the switch is open, the input pin will read 0.
    > When the switch is closed, the input pin will read 1.
    >
    >
    >
    >
    > --- In basicstamps@yahoogroups.com, "kailip" <lou@u...> wrote:
    > > Hi,
    > > I am very new to stamps, so please excuse my ignorance. I am
    > > building a kinetic sculpture, and want to use a SPST switch as an
    > > input device. Can this be done??
    > >
    > > Thanks
  • ArchiverArchiver Posts: 46,084
    edited 2003-06-01 19:43
    This sucks, it looked fine on the preview.

    --- In basicstamps@yahoogroups.com, "selket_10027"
    <selket_10027@y...> wrote:
    > Sorry about that, the browsers doesn't display my ASCII art
    properly.
    > I'll try again
    >
    > <tt>
    > V++
    > -+-
    > | /
    > +
    O O----+
    > Input Pin
    > |
    > \
    > /
    > \ 10k
    > /
    > |
    > V
    >
    > </tt>
    >
    >
    > > When the switch is open, the input pin will read 0.
    > > When the switch is closed, the input pin will read 1.
    > >
    > >
    > >
    > >
    > > --- In basicstamps@yahoogroups.com, "kailip" <lou@u...> wrote:
    > > > Hi,
    > > > I am very new to stamps, so please excuse my ignorance. I am
    > > > building a kinetic sculpture, and want to use a SPST switch as
    an
    > > > input device. Can this be done??
    > > >
    > > > Thanks
  • ArchiverArchiver Posts: 46,084
    edited 2003-06-01 20:29
    In a message dated 6/1/2003 11:35:05 AM Pacific Daylight Time,
    lou@u... writes:

    >
    > Hi,
    > I am very new to stamps, so please excuse my ignorance. I am
    > building a kinetic sculpture, and want to use a SPST switch as an
    > input device. Can this be done??
    >
    > Thanks

    yes


    [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2003-06-01 22:41
    I think you actually want to have the pin itself pulled up or down when the
    switch is open. Its usually bad juju to leave a processor (or Stamp) pin
    flapping in the breeze.

    Original Message

    > Sorry about that, the browsers doesn't display my ASCII art properly.
    > I'll try again
    >
    > <tt>
    > V++
    > -+-
    > | /
    > +
    O O----+
    > Input Pin
    > |
    > \
    > /
    > \ 10k
    > /
    > |
    > V
    >
    > </tt>
    >
    >
    > > When the switch is open, the input pin will read 0.
    > > When the switch is closed, the input pin will read 1.
  • ArchiverArchiver Posts: 46,084
    edited 2003-06-01 23:46
    You might also use the command BUTTON to debounce the switch, with your
    circuit. Not sure what Rodent meant, because the circuit as shown pulls
    the pin down when the switch is open, and the pin goes high when the the
    switch is closed. See the instruction for BUTTON in the BS1 manual,
    showing two configurations of your circuit.

    Dennis

    Original Message
    From: Rodent [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=9FhZ3Gvj_jy1vB0ECUj-sDy3_jwK71nJq7vGnT88LzD2GwKqhpKd5DEarKD4CZLgOBDqyxzHl3xwbTk]daweasel@s...[/url
    Sent: Sunday, June 01, 2003 2:42 PM
    To: basicstamps@yahoogroups.com
    Subject: Re: [noparse][[/noparse]basicstamps] Re: spst switch as input device


    I think you actually want to have the pin itself pulled up or down when
    the switch is open. Its usually bad juju to leave a processor (or Stamp)
    pin flapping in the breeze.

    Original Message

    > Sorry about that, the browsers doesn't display my ASCII art properly.
    > I'll try again
    >
    > <tt>
    > V++
    > -+-
    > | /
    > +
    O O----+
    > Input Pin
    > |
    > \
    > /
    > \ 10k
    > /
    > |
    > V
    >
    > </tt>
    >
    >
    > > When the switch is open, the input pin will read 0.
    > > When the switch is closed, the input pin will read 1.




    To UNSUBSCRIBE, just send mail to:
    basicstamps-unsubscribe@yahoogroups.com
    from the same email address that you subscribed. Text in the Subject
    and Body of the message will be ignored.


    Your use of Yahoo! Groups is subject to
    http://docs.yahoo.com/info/terms/
  • ArchiverArchiver Posts: 46,084
    edited 2003-06-01 23:55
    It certainly can.

    On Sunday, June 1, 2003, at 02:33 PM, kailip wrote:

    > Hi,
    > I am very new to stamps, so please excuse my ignorance. I am
    > building a kinetic sculpture, and want to use a SPST switch as an
    > input device. Can this be done??
    >
    > Thanks
    >
    >
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject
    > and Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2003-06-02 00:08
    The way it looks on my PC, the pin is open unless the switch is closed.
    Anyway, you should never leave a pin unconnected or tie the pin direct to +5
    or ground.

    Original Message

    > You might also use the command BUTTON to debounce the switch, with your
    > circuit. Not sure what Rodent meant, because the circuit as shown pulls
    > the pin down when the switch is open, and the pin goes high when the the
    > switch is closed. See the instruction for BUTTON in the BS1 manual,
    > showing two configurations of your circuit.
  • ArchiverArchiver Posts: 46,084
    edited 2003-06-02 15:13
    try using the 'button' command to look for the switch closure

    jim
    http://www.geocities.com/jimforkin2003/


    Original Message
    From: Mark Marpet [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=NDdMkDbYJj6XUpkgYoyWB3D-3Vz9Jl5W94re7hL-CayBccnfaNPO4t_wVFVLcmoJBC3Sv35R9-wFy2I]marpetm@s...[/url
    Sent: Sunday, June 01, 2003 6:55 PM
    To: basicstamps@yahoogroups.com
    Subject: Re: [noparse][[/noparse]basicstamps] spst switch as input device


    It certainly can.

    On Sunday, June 1, 2003, at 02:33 PM, kailip wrote:

    > Hi,
    > I am very new to stamps, so please excuse my ignorance. I am
    > building a kinetic sculpture, and want to use a SPST switch as an
    > input device. Can this be done??
    >
    > Thanks
    >
    >
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject
    > and Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    >
    >
    >


    To UNSUBSCRIBE, just send mail to:
    basicstamps-unsubscribe@yahoogroups.com
    from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.


    Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
Sign In or Register to comment.