How would one take a single input (e.g. from a button) and make that output a binary code (5 wires for maximum 16 buttons). E.g. button 1 would poll some type of device which would then output the binary signal "1".
I think the problem is that in binary 1 is 0001, 2 is 0010, 3 is 0011, etc. So to tell us that "I press A, I get 1" is not really how it works.Here's an image.
Ok. Lets start with the ground floor.Well what im wondering is , say you press button 4, and it's on the 4th input, how would a priority encoder change that into 4 in binary. I'm working with carking on this btw.
So would a microcontroller be the correct way to go in this case?. We'd only be using 5 lines of binary (max 16), because our controllers won't be using 255 buttons .
They will be connected to 5 pins in the GPIO, which would be polled by Python, with >20 GPIO pins we could fit 2 controllers with a 5 pin interface easily. This is the only roadblock atm.
11 buttons can be done with either 11 pins or 22 pins.I'm very very sorry if I sound dense or anything. I'm just new to this type of stuff.
Would it be easy to do this? Or easier with something like a serial interface. The big thing is the fact that we need to use GPIO pins.