How to read a switch
Archiver
Posts: 46,084
I am using the BS2 and want to use 2 I/O pins for
connection to a switch. This switch will be used as a
table selection. The following is the truth table;
SW1 SW2 Table Selected
0 0 0
0 1 1
1 0 2
1 1 3
What I want to do is read the logic state of these two
inputs and have the software use the proper lookup
table.
Thanks for any help
John
__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/
connection to a switch. This switch will be used as a
table selection. The following is the truth table;
SW1 SW2 Table Selected
0 0 0
0 1 1
1 0 2
1 1 3
What I want to do is read the logic state of these two
inputs and have the software use the proper lookup
table.
Thanks for any help
John
__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/
Comments
> I am using the BS2 and want to use 2 I/O pins for
> connection to a switch. This switch will be used as a
> table selection. The following is the truth table;
>
> SW1 SW2 Table Selected
> 0 0 0
> 0 1 1
> 1 0 2
> 1 1 3
>
> What I want to do is read the logic state of these two
> inputs and have the software use the proper lookup
> table.
>
> Thanks for any help
>
> John
>
would this work?
switches var nib
switches = in1 << 1 | in2
branch switches, [noparse][[/noparse]action0, action1, action2, action3]
--- Mike Eggleston <mikee@m...> wrote:
> On Thu, 08 Mar 2001, John DeFeo wrote:
>
> > I am using the BS2 and want to use 2 I/O pins for
> > connection to a switch. This switch will be used
> as a
> > table selection. The following is the truth table;
> >
> > SW1 SW2 Table Selected
> > 0 0 0
> > 0 1 1
> > 1 0 2
> > 1 1 3
> >
> > What I want to do is read the logic state of these
> two
> > inputs and have the software use the proper lookup
> > table.
> >
> > Thanks for any help
> >
> > John
> >
>
> would this work?
>
> switches var nib
>
> switches = in1 << 1 | in2
>
> branch switches, [noparse][[/noparse]action0, action1, action2,
> action3]
>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>
__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/