Debounce Library

I'm trying to use the debounce library.

Downloaded the file and placed the folder in the library folder.

Debounce examples now appear; so I load the Example named debounce and try to compile it and get error messages: 'Debounce' does not name a type.

Did not edit the example - just trying to use it "as - is".

Think this is some type of newbie error but doh! Clueless. All the other examples I have tried compiled.

Is that the only error you get?

No easy way to cut and paste the entire error message; will type it…

debounce.pde: -1: error: ‘Debounce’ does not name a type
debounce.cpp: In function ‘void loop ()’:
debounce.pde: -1: error: ‘debouncer’ was not declared in this scope

Here is the Example:

// This code turns a led on/off through a debounced switch


#include <Debounce.h>
#define SWITCH 5
#define LED 13

// Instantiate a Debounce object with a 20 millisecond debounce time
Debounce debouncer = Debounce( 20 , SWITCH ); 

void setup() {
  pinMode(SWITCH,INPUT);
  pinMode(LED,OUTPUT);
}

void loop() {
 // Update the debouncer
  debouncer.update ( );
 
 // Get the update value
   digitalWrite(LED, debouncer.read() );
 
}

Which version of the IDE are you using?

1.0 is what I see at top of "About Arduino"...

So you must have done the 'WProgram.h' change, as the debounce library I just downloaded hadn't been updated for 1.0.

dxw00d:
So you must have done the ‘WProgram.h’ change, as the debounce library I just downloaded hadn’t been updated for 1.0.

I don’t think I did any changes? Have only had the arduino about a month or two and downloaded the software at that time.
I also have a bounce library, with examples, that is installed. Same error there. I didn’t download the bounce library; it came with the initial software download is my best guess.

Oh well. Back to the drawing board. :smiley:

I'm trying to use the debounce library.

Downloaded the file and placed the folder in the library folder.

Same error there. I didn't download the bounce library

Did you download a debounce library or not?

Sorry for the confusion.

There are two libraries:
Bounce I did not download; came with 1.0 ; examples don’t compile
Debounce I did download; examples don’t compile

Other library I downloaded with examples that compile:
AFMotor

Bounce I did not download; came with 1.0 ; examples don't compile

There is no Bounce library with my 1.0, what was the example called?

Grumpy_Mike:

Bounce I did not download; came with 1.0 ; examples don't compile

There is no Bounce library with my 1.0, what was the example called?

Bounce Library Examples are: bounce, change, duration, edge, rebound

Debounce Library Examples are: debounce, monitorChange

Grumpy_Mike:

Bounce I did not download; came with 1.0 ; examples don't compile

There is no Bounce library with my 1.0, what was the example called?

Same here. I only have the Debounce example sketch, which doesn't use a library.

Bounce I did not download; came with 1.0 ; examples don’t compile

Did you have a previous version of the arduino before 1.0. If you did and downloaded a library called Bounce that would still be present, but there is no Bounce library with 1.0.

http://arduino.cc/playground/Code/Bounce
Says:-

Bounce is the new version of the Debounce library

and:-

Version
1.6: Fixed for Arduino 1.0

So download version 1.6 and try again.

Yep, that worked.

:D

Thanks.

I went to the Arduino website, then the Reference page, then the Libraries page and assumed those are the most up to date libraries?

I went to the Arduino website, then the Reference page, then the Libraries page and assumed those are the most up to date libraries?

Don't you know what you did?

:smiley:

I do know what I did! Wish I knew more!

Just made the incorrect assumption that going to the Reference Web Page “Libraries” was the correct place to go.

Scroll down on this page to see the library “Debounce”;
http://arduino.cc/en/Reference/Libraries
I assumed this page was the most up to date. It is not.

Actually don’t know where the most up to date “Reference” is.

Not sure how to close a thread but I’m in business now, thanks!

Not sure how to close a thread

You stop asking or responding to questions. ;)

You stop asking or responding to questions.

Or you remove the reply button (bad idea in my opinion) or you modify the initial thread title to add "SOLVED" (or some variation) to the title.