|
Re: Programming Toggle Swiches
Chris,
Read them both in as Boolean then convert to a number. Each will be a zero or a one.
Now multiply #2 by 2 and add to #1. You now have a number ranging from 0 to 3.
Put this into a switch or case statement (depending on your programming language).
You're done...
Mike
__________________
Mike Betts
Alumnus, Team 3518, Panthrobots, 2011
Alumnus, Team 177, Bobcat Robotics, 1995 - 2010
LRI, Connecticut Regional, 2007-2010
LRI, WPI Regional, 2009 - 2010
RI, South Florida Regional, 2012 - 2013
As easy as 355/113...
|