In the first tutorial you created a program to control a servo via REPL; then, in the second tutorial you added a slider to control the servo. In this tutorial, we’re going to set the servo and slider aside and build a simple “on/off” switch with a bumper and an led:
New Parts list:
First, set up the hardware using this schematic as your guide:
Connect the following…
Assuming you’re using the actual repo, open up
eg/button-bumper.js, or follow along here…
And that’s it!
node eg/button-bumper.js1 and try tapping and/or holding the bumper down — the led should switch on and off as you press and release.
Remember to watch this space for more tutorials!
Note: There is a known issue in where the Firmata protocol layer has issues freeing itself on the serial line which results in the program hanging in the ready state. For now,
^C to kill the hanging program and simply run it again.