debouncing tunable in micros() iso millis() ??? // they are called micro switches after all
I'm having difficulty with this part
I've tried various ways and keep getting type errors and when I fix the type errors I get things such as " milli is not defined in this scope". Any help is much appreciated
Not a good idea. Global class instances result in calling the constructor before init() is called. Diddling with the mode of a pin will prove useless when init() sets the mode of all pins later.
There are already several libraries around for dealing with switches. They all use the name Button. Why escapes me. Buttons are for keeping shirts closed.
Use a unique name for your class, to prevent conflicts with other libraries written by equally unimaginative people.
There are already several libraries around for dealing with switches. They all use the name Button. Why escapes me. Buttons are for keeping shirts closed.
might be the difference between American English and other kinds of English?
In Dutch I know a switch (schakelaar) can have a button (knop) so that might explain it to you.
Not a good idea. Global class instances result in calling the constructor before init() is called. Diddling with the mode of a pin will prove useless when init() sets the mode of all pins later.
Thanks for the input!
Use a unique name for your class, to prevent conflicts with other libraries written by equally unimaginative people.
I wrote this code for myself, I'm sharing it incase someone else finds it of use. Presumably they wont be using more than one button class? If they are then they can change it if they wish.
I would suggest that your inability to perceive of a reason as to why a push switch could be called a button might betray your own lack of imagination.
I would suggest that your inability to perceive of a reason as to why a push switch could be called a button might betray your own lack of imagination.
And, I would suggest that using a name that refers to a specific kind of switch as a general name referring to all kinds of switches betrays your lack of imagination.