Need some help here!
Creative
Posts: 11
Hi,
·· I'm desperately thinking of ideas to improve my incompleted 'Memory Teaser' game. I have 9 leds and 9 switches. I need to find ways to solve the deboucing problem on the switches. You know, the way keyboard works? When you press a button, the results show on scrn? If possible, links/threads purtaining to solutions for the problem could be pasted here. Thank you!
·· I'm desperately thinking of ideas to improve my incompleted 'Memory Teaser' game. I have 9 leds and 9 switches. I need to find ways to solve the deboucing problem on the switches. You know, the way keyboard works? When you press a button, the results show on scrn? If possible, links/threads purtaining to solutions for the problem could be pasted here. Thank you!
Comments
http://forums.parallax.com/showthread.php?p=558337
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
Post Edited (Chris Savage (Parallax)) : 12/7/2005 4:32:51 PM GMT
Have you read in the help file about the BUTTON instruction?
Ryan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Ryan Clarke
Parallax Tech Support
RClarke@Parallax.com
Method used to find: http://search.parallax.com·· keyword: debounce
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·1+1=10
http://www.parallax.com/html_pages/downloads/sw/sw.asp
Check out the FREE downloads!
SwInputs··· VAR· InS
switches···· VAR· Word
DEBUG Home, "Inputs = ", IBIN9 switches
switches··= %0000000111111111
The switches are connected to P0-P8.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·1+1=10
Post Edited (Paul Baker) : 12/8/2005 4:43:19 PM GMT
One thing I can say though, even when I figure something out myself, a reply from one of many talented gurus here that answers the question sometimes answers it in a way that makes it much more clear to me than my own conclusion even though both of the solutions to the problem as essentially the same. These folks sometimes don't realize from our perspective the small seemingly insignificant clues they include in their responses to our questions that greatly improve our understanding of physics.
I am very lucky to have a brother in-law who just happens to be a very hi tech electronics genius. I Just finished a simple project that worked perfectly fine for what it would do. After showing it to him and asking his opinion he immediately recalculated the number and types of components I was using, narrowed it down to 2 chips that used 1/5 of the power I was using and lowered the cost to produce by 90%. I am an infant when it comes to the brainpower of some of the folks around here and I consider it a privilege to be able to interact with them.
So keep on posting those questions, heck I can read pretty fast and I would like to see more questions I can answer....
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Think outside the BOX!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·1+1=10
First look at the amount of time it should take before you need to process the key again once you receive the signal that it is closed.
If you have a human pressing just one key and letting go of it quickly you would think about how fast a person could press that key. Now relate that to the number of times your program can scan the key.
For example, if you only need input once per 3 seconds on any given key, you could simply wait 3 seconds before reading the key. That would enable you to respond to the keypress instantly. You would then set up either a clock using RCtime circuit, or count lines of code in your main loop to estimate the time elapsed before reading the key again. When it comes to microprocessors you need to wrap your mind around the huge time difference in the way you normally think about time. Think of it as looking through a microscope to see the individual atoms that make up the stuff all around us. So a switch contact if looked at under a microscope, you would see sparks flying everywhere, slow time down to your normal view of time and you would see the vibration of both surfaces on the initial contact causing what is called a ringdown vibration or wave. When you bring your thinking into this level you start to see many new ways of gathering data and sending data (electric pulses or Voltage amplitudes) That way you don't just plug in code that works, you understand why it works. Think of yourself being the size of one atom and look at the world from that perspective.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Think outside the BOX!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·1+1=10
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Think outside the BOX!
If you are trying to explain switch contact bounce, I think you are on the wrong track. Bounce is typically a physical phenomenon. Inside the switch there is typically some type of metal strip that makes contact with a metal post. The actual mechanism for this depends on the switch's type (lever, pushbutton, slide, knife, etc...). When the switch is turned "on", by whatever mechanism, there are several "make and break" events as the two electrodes come together. This is typically caused by the electrodes "rubbing" over each other or springiness of the "strip"...again it depends on the mechanism of the switch.
Sparks, as you describe them, would generally require quite a bit of potential difference to jump the gap (high-voltage). I suppose that there could be an argument for an ever-so-slight "capacitative"-type of effect, but I doubt that it would be sufficient to affect typical switching situations.
Of course, I could have completely missed the boat as far as your response is concerned...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Truly Understand the Fundamentals and the Path will be so much easier...