View unanswered posts | View active topics It is currently Thu Oct 30, 2014 12:43 pm






Reply to topic  [ 2 posts ] 
Superpro prototypeboard 
Author Message
Rookie

Joined: Wed Jan 22, 2014 10:36 am
Posts: 1
Post Superpro prototypeboard
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).
Image


Wed Jan 22, 2014 11:29 am
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1347
Post 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.


Wed Jan 22, 2014 1:40 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.