I unzipped the bounce folder to the correct directory and imported it into my sketch and I got this error:
C:\Program Files (x86)\arduino-0017\hardware\libraries\Bounce\Bounce.cpp:52: error: expected constructor, destructor, or type conversion before 'void'
I am not sure what that means. I got that error from just importing the library into the sketch, so I thought it meant that I wasn't using bounce in my code so I added it to my code and still same problem. I am also using the Metro library, I will check if there is a conflict between them since I don't really know what the internal code of the libraries are.
Nope, libraries should have nothing to do with which board you're using. (well in terms of just installing a library, using them can be a different story, but you're fine)
I had the same problem when I downloaded the bounce library.. I just removed it and didn't bother. I don't mind putting a capacitor next to a switch, and seems to work almost as well.
It sounds like it's just missing a { here or there, but I'm not a code-guru yet.. so just looking at libraries scares me sometimes!
I'm sure somebody will come along and point the problem out soon.
I definitely would like to use the library if possible, I just don't know how I could have screwed anything up by just importing the library; code worked fine before that.
Anyways, how'd you pick out what capacitor to use? And you say it works almost as well; does that mean it removed most of the bouncing or what exactly?
Well I think that may have been alot of my problem.. I didn't really know which size to use.. and I only had a choice of like 4 values that come with an experimental kit. I've heard when filtering noise from small sources as such with only like 5ma, the smaller the better.
But when I use the capacitor VS not using, it's at least a 70% difference.
I pushed the button about 10 times without.. and I got about 25 button pushes, give or take.
But when I used the capacitor (says 103, sorry dunno the value :X) I did the same experiment only counting 15. And I'm sure some of it was because I was holding the button down longer than I normally do for testing sake!
I am surprised that so few results show up when I do a forum search for bounce or debounce, and none of it is useful.
However I no longer need it. My code isn't effected by the button bounce afterall. I'm not 100% sure what causes my problem but it certaintly isn't bounce; I fixed bounce with a delay and thats when I noticed the pattern which wasn't bounce oriented.
CaptainObvious, there are many sites that talk about hardware debounce if you want to fix your hardware solution so that it removes all of the bounce. I didn't look at them long enough to know exactly how to do it, just long enough to know that I could figure it out from the info. Here is a good site/pdf about it: http://www.ganssle.com/debouncing.pdf