Pages: 1 [2]   Go Down
Author Topic: Bouncing exceeding 200 ms  (Read 1929 times)
0 Members and 1 Guest are viewing this topic.
Copenhagen, Denmark
Offline Offline
Edison Member
*
Karma: 33
Posts: 1226
Have you testrun your INO file today?
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
smiley 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.
Logged

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 150
Posts: 5666
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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


Logged

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

Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
smiley 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.
Logged

Pages: 1 [2]   Go Up
Jump to: