Before we program our button project, let's take a good look at the Johnny-Five button object, so we know what events to look for, and what information the constructor wants from us.
The Johnny-Five button object
The button object
When we look at the button's parameters section, there is only one required parameter, pin. So we'll need to remember what pin to which we hook the signal from the button, but other than that, the defaults will serve us nicely:
- invert: Defaults to false, and inverts the up and down values. We'd like to keep this false, as we're wiring the button to not require inversion.
- isPullup: Tells boards with pull-up resistors tied to their GPIO pins to initialize this button with...