do not trigger click event if hold event was triggered before

otherwhise hold and click event are triggered both
Merge pull request #26 from cyborgsimon/master

do not trigger button click event if hold event was triggered before
add use(item) and select(item)
Changed framework/libraries/Button

changed isPressed() to scan(), as I found using the isPressed() method awkward in terms of readability, in event mode.

added property sets:
- setDebounceDelay (changed from setDebounceTime)
- setHoldRepeat (to set repeat calls to the Hold event)

added property gets:
- getPin (to identify the button in handlers)
- getHoldRepeatCount (to get the number of times the hold event has been called during the current hold)

changed the size of some of the reporting members
- times, since they could be longer than 65 seconds
- numberOfPresses, since you could conceivably have more than 65K presses on a single button.

I cleaned up the debounce logic.

I changed the multi click functionality - and IMO the logical way to do it.  See below.

The onClick handler isn't called unless the multi click threshold has expired, and it will only fire ONCE for multi clicks.  So, if the multi click threshold is 0, then ALL clicks events are fired, but if it is > 0, then only a single click event is fired if more than one click fits within the threshold.  What this means is that if you get a "double click", then you only get a single click event, and it is identified as a "double click" - you could theoretically have a octuple click - eek! :)

Finally, the main reason for the changes - I needed Hold event repeats!  So now it's done. Now, if the button is held longer than the initial hold threshold + hold repeat, a second Hold event will be fired. If held longer, it will continue to call the Hold event, according to the holdEventRepeatTime interval.  There is a reporting member (getHoldRepeatCount) to get the number of times the hold event has been called.

Signed-off-by: Brett Hagman (bhagman-ws1) <bhagman@roguerobotics.com>
Adding the MLAB fork of Arduino into Wiring project
deleting the programmers selection (not tested)
can't inline methods from outside .h

We had a reference error if WSPI::setBitOrder was called from the sketch. This is the fix, thanks to Carlos Mario Rodriguez Perdomo for discovering the bug.
Adding MenuItem-level callbacks for MenuBackend

The previous implementation allowed 3 callbacks to be defined on the
root-level MenuBackend instance (menuUse, menuChange and itemChange).
This commit introduces 8 callbacks for MenuItems:

* onChangeFrom / onChangeTo - called when the current menu is changed
away from/to the base MenuItem
* onUp / onDown / onLeft / onRight - called when moveUp, etc is called
with the base MenuItem as the current menu
* onUse - called when use() is called with the base MenuItem as the
current menu

These callbacks should simplify code organization in some cases by
eliminating the need for a complex case statement to handle all menu
events.
Merge pull request #30 from kerinin/MenuBackend_callbacks

Adding MenuItem-level callbacks for MenuBackend
Merge pull request #28 from bhagman/master

Changed framework/libraries/Button
Merge pull request #29 from jashinsama/master

Add MLAB fork of Arduino (LABduino) into Wiring
make save and restore explicit
add explicit save