Hey guys,
I'm not too familiar with C++ or object oriented programming in C or whatever this is:
Bounce bouncer = Bounce( BUTTON,5 );
But I've done some OOP in another language, so that first Bounce there I think is the name of the object, and is being used like a variable type to declare the variable.
But when I tried to do this in my code:
Bounce modeSwitch;
Which worked perfectly fine with the Servo lib, so I could declare my global variable before I instantiated my object. (I think that's the right term)
But with Bounce I got this error:
error: no matching function for call to 'Bounce::Bounce()'C:\Documents and Settings\Shawn\Desktop\Arduino\libraries\Bounce/Bounce.h:37: note: candidates are: Bounce::Bounce(uint8_t, long unsigned int)
C:\Documents and Settings\Shawn\Desktop\Arduino\libraries\Bounce/Bounce.h:33: note: Bounce::Bounce(const Bounce&)
Any idea what's up with that? Why can I used Bounce to declare my variable if I immediately assign it a pointer to a Bounce object, but not if I want to assign it a pointer later? Is it just a fluke of how the library is written?
[edit]
Hm... looking at the Servo lib now to see the differences. I think what I'm dealing with here is called a Class, but I'm not sure where doing:
Servo myServo;
Comes in... I think that may have called Servo::Servo(), since the Bounce call I made seems to be calling Bounce:Bounce() and failing because I didn't specify the function parameters.
Which leaves me to wonder what exactly I did when I put" Servo myServo;" in my code. Did that try to create a class instance or whatever it's called and then just do nothing with it because I didn't assign it to anything? So confused.