Go Down

Topic: Bouncing exceeding 200 ms (Read 2 times) previous topic - next topic

Msquare


delay() is the Devil's Function. Tempting newbies in, making them think they're doing real programming when all the time they're only digging fiery pit for themselves
:) and thumbs up/like!

Otherwise I'll chime in - Using the millis() and two lines og code does do software debouncing without any real overhead better/as good as any hardware solution. It may be your buttons do not hold the contact but have such a lousy contact (high resistance) that you dont see "bounce" but more of a "cant quite keep the circuit closed". To test do loop() with only Serial.write((digitalRead(button)==LOW)?'0':'1') and look at it. An oscilloscope would be better.

fungus


It looks like you should get some better switches.


This, too. $10 spent on microswitch arcade buttons could make all of this moot.

http://www.ebay.com/sch/i.html?_nkw=microswitch+arcade+buttons


No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

SquishyFish


Quote
But if you need to detect a button release in less than the bounce time I'm not sure there is a decent solution.

I am sure that there isn't if that is what you need.
It looks like you should get some better switches.


delay() is the Devil's Function. Tempting newbies in, making them think they're doing real programming when all the time they're only digging fiery pit for themselves
:) and thumbs up/like!

Otherwise I'll chime in - Using the millis() and two lines og code does do software debouncing without any real overhead better/as good as any hardware solution. It may be your buttons do not hold the contact but have such a lousy contact (high resistance) that you dont see "bounce" but more of a "cant quite keep the circuit closed". To test do loop() with only Serial.write((digitalRead(button)==LOW)?'0':'1') and look at it. An oscilloscope would be better.


Starting to think mechanics are the issue. I assumed the switches were high quality, but they're actually just generic knockoffs of the cherry's listed on that ebay link.

Will switch to unsigned longs and do some testing this evening. Thanks for the input guys.

Go Up