FIRST Robotics Competition Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Binary to decimal

I need to convert 4 true/false switch inputs to decimal to select one of 16 case structures. Can someone help me do that?

0 Kudos
Message 1 of 3
(6,690 Views)

I'm assuming you already have them in as booleans. Just make an array out of them and then use the Boolean Array to Number.

http://josh.whtiger.net/images/btns_to_number.png

😃

0 Kudos
Message 2 of 3
(2,658 Views)

Thanks, simple as that!

0 Kudos
Message 3 of 3
(2,658 Views)