|Page 1 of 1|
|Author:||3954WattsUp [ Wed Jan 22, 2014 11:29 am ]|
|Post subject:||Superpro prototypeboard|
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).
|Author:||MHTS [ Wed Jan 22, 2014 1:40 pm ]|
|Post subject:||Re: Superpro prototypeboard|
Let me ask you a question because I think there is a better solution. What do you use these 5 buttons for? If you are using them for selecting which autonomous strategy to run, why can't you use the NXT buttons and LCD so you can display a choice menu and press the left/right and enter buttons to select and choose strategy?
Generally, a button should be connected to a digital input. On the SuperPro board, there are 8 digital I/O pin. You need to connect the one end of the 100K resistor to 5V, the other end to one of the digital I/O pin and then the digital I/O pin needs to also connect to one side of the "Normal-Open" button. The other side of the button is connected to ground.
|Page 1 of 1||All times are UTC - 5 hours [ DST ]|
|Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group