>>>>>noob questions here<<<<<
QUARKSPIN
Posts: 36
My (Dumb) question is....
Here it comes...
How do you make the prop see when you press a button?
More specificly, why does my setup toggle between on and off extremely fast? I have one side of the button connected to a resistor, and then to ground, and the other side connected to I\O pin 5. I'm guessing it has something to do with 0 volts not being counter as a zero in my input register, (Because it stops turning on and off when I press the button)
I know there is a very easy way to fix this, could someone give me a schematic or something?
Oh, And rather than kill the forum with thousands of new threads, I'm going to put all my other questions here.
Here it comes...
How do you make the prop see when you press a button?
More specificly, why does my setup toggle between on and off extremely fast? I have one side of the button connected to a resistor, and then to ground, and the other side connected to I\O pin 5. I'm guessing it has something to do with 0 volts not being counter as a zero in my input register, (Because it stops turning on and off when I press the button)
I know there is a very easy way to fix this, could someone give me a schematic or something?
Oh, And rather than kill the forum with thousands of new threads, I'm going to put all my other questions here.
Comments
--also, reading your post a second time it sounds like you put the power for both 3.3v and ground on one side, so when it isn't connected to the pin you are allowing to float, causing random changes in signals.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
PG
Post Edited (Pi Guy) : 1/24/2010 12:31:00 AM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I'm smart, cause' I say smart stuff like this:
"Hardware is what you have if you want to make that little light on the front turn on."
--QUARKSPIN
And...
"Sometimes some stuff does stuff like... um..."
--QUARKSPIN
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
PG
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I'm smart, cause' I say smart stuff like this:
"Hardware is what you have if you want to make that little light on the front turn on."
--QUARKSPIN
And...
"Sometimes some stuff does stuff like... um..."
--QUARKSPIN
Do you understand Ohm's Law? If not, please read the Wikipedia article on it. It's basic to this question and probably a lot of others you might have.
Look at the examples in the "What's a Microcontroller?" tutorial from Parallax. It's written for the Stamps and for 5V logic, but the same ideas apply to the Propeller and 3.3V logic. You may have to change resistors and the code is a bit different, but not a lot. The resistors are generally proportional to the supply voltage (there's that Ohm's Law again!).
Do you know how to read the resistor color codes? If not, look for a Wikipedia article on the subject. It's another piece of really basic information you need.
go to page 33/34
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
PG
The series resistor value is normally low enough to be able to use this pin as an output with sufficient current to drive an led for example. Using a value of around 220R allows an led to be connected directly. The lowest value that would be advisable would be around 100R. Using current limit resistors on general-purpose boards is good practice as it is common to have software errors or side-effects that would otherwise possibly damage the Prop.
For push-button inputs a pullup/down resistor value of around 1K to 10K is normally used as this provides sufficiently low input impedance so that the pin would not be overly affected by stray EM fields inducing false readings. If your button was connected via a long length of cable then you would use a lower value of pullup/down resistor and po isssibly even a capacitor across the button as well for low AC impedance and debouncing. There is also the issue of providing enough "wetting" current so that the switch contacts remain clean (google this up if you want).
On the subject of pushbutton inputs IMO I prefer to ground the pushbutton and use a pullup resistor rather than the PE kit example, although for the example there isn't a problem in doing it that way. The reason I have is that a clean and stable supply is essential to operation of the processor so I would avoid running it around to things that don't need it and through which noise could be injected on the supply or the supply shorted against a "ground". Imagine running a button a foot or two away, if you tie the button to the 3.3V supply then that cable becomes an antenna, both transmitting noise and receiving it.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
*Peter*