Assigning multiple pin reading to a variable
silverback
Posts: 40
I know what I want to accomplish, but don't know where to start looking.
I am going to use a three button·station to control a boe-bot (via tether).
I have checked out the unit to make sure that (connect to p15) will read the pin state in real-time.
what I need to do is assign all three pin readings into a single· variable (for simplicity sake).
With this variable, the program will inform the bot which direction to go.
assuming the pins are 15 14 13
I need to have a variable that reads all three pin states to direct the bot.
each button will connect to a pin and control logic is as follows:
3ControlStation var byte
(needs to gather the following data)
in15 in14 in 13
·0···· 0····· 0 = forward
·0···· 1······0 = turn right
·1···· 0····· 0 = turn left
·0···· 0····· 1 = stop (unit has a normally closed button)
·1···· 1····· 1 = reverse
·What command would allow me to assign three pins to a variable?
Using BS2 and BOE Rev C.
Thanks for the help
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
If you convince yourself that something is impossible before you even try; you are sure to prove yourself right.
Post Edited (silverback) : 2/15/2010 12:03:19 AM GMT
I am going to use a three button·station to control a boe-bot (via tether).
I have checked out the unit to make sure that (connect to p15) will read the pin state in real-time.
what I need to do is assign all three pin readings into a single· variable (for simplicity sake).
With this variable, the program will inform the bot which direction to go.
assuming the pins are 15 14 13
I need to have a variable that reads all three pin states to direct the bot.
each button will connect to a pin and control logic is as follows:
3ControlStation var byte
(needs to gather the following data)
in15 in14 in 13
·0···· 0····· 0 = forward
·0···· 1······0 = turn right
·1···· 0····· 0 = turn left
·0···· 0····· 1 = stop (unit has a normally closed button)
·1···· 1····· 1 = reverse
·What command would allow me to assign three pins to a variable?
Using BS2 and BOE Rev C.
Thanks for the help
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
If you convince yourself that something is impossible before you even try; you are sure to prove yourself right.
Post Edited (silverback) : 2/15/2010 12:03:19 AM GMT
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
If you convince yourself that something is impossible before you even try; you are sure to prove yourself right.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
If you convince yourself that something is impossible before you even try; you are sure to prove yourself right.
·