Hi all!
I have a programming/electrical related question. I want to get a prototype board with some buttons on it connected to my NXT, in order to change an integer in my code. However, I just can't find out how I would do so.
In total, I want 5 working buttons. I think this will mean I need to wire the buttons to the digital inputs, since there are only 4 analog inputs. I might be wrong over here, I'm not sure if this will work. I want to get the integer in my code to get affected by the buttons. If the button gets pressed, it goes up by one. If another button is pressed, it needs to one up (or down, I will sort this out later) again.
If I am correct by saying I need to wire them to the digital inputs, I figured (by reading the sample files) that I need to set the digital ports to
inputs instead of
outputs.
Beneath is my electric circuit, but only with two buttons.
Is anybody able to help me out?
Excuse me if I made any grammer or spelling mistakes.
Thanks in advance.
(The resistors that lead the not-pressed buttons to the ground are 100k Ohm).
