Breadboard for "ESC - Bidirectional"


Fritzing diagram: esc-bidirectional.fzz


Run this example from the command line with:

node eg/esc-bidirectional.js
var five = require("../");
var board = new five.Board();

board.on("ready", function() {
  var start =;
  var esc = new five.ESC({
    device: "FORWARD_REVERSE",
    neutral: 50,
    pin: 11
  var throttle = new five.Sensor("A0");
  var brake = new five.Button(4);

  brake.on("press", function() {

  throttle.scale(0, 100).on("change", function() {
    // 2 Seconds for arming.
    if ( - start < 2e3) {

    if (esc.value !== this.value) {


Component Classes in this example:

Hi! The Johnny-Five community is building new projects every day. We made this newsletter to tell you about what's new, what's good, and what's next for Open Source robotics. Join us in exploring what we can make together.

Fork me on GitHub