Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
86 lines (45 sloc) 1.32 KB

Button - Pullup

Breadboard for "Button - Pullup"


Fritzing diagram: docs/breadboard/button-pullup.fzz


Run this example from the command line with:

node eg/button-pullup.js
// The `isPullup` button option enables the pullup
// resistor on the pin and automatically sets the
// `invert` option to true

// In this circuit configuration, the LED would always
// be on without the pullup resistor enabled

// For more info on pullup resistors, see:

var five = require("johnny-five"),
  button, led;

five.Board().on("ready", function() {

  button = new five.Button({
    pin: 2,
    isPullup: true

  led = new five.Led(13);

  button.on("down", function(value) {

  button.on("up", function() {;




Copyright (c) 2012-2014 Rick Waldron Licensed under the MIT license. Copyright (c) 2015-2019 The Johnny-Five Contributors Licensed under the MIT license.

You can’t perform that action at this time.