Skip to content

Latest commit

 

History

History
69 lines (35 loc) · 1.02 KB

esc-bidirectional.md

File metadata and controls

69 lines (35 loc) · 1.02 KB

ESC - Bidirectional

Breadboard for "ESC - Bidirectional"

docs/breadboard/esc-bidirectional.png

Fritzing diagram: docs/breadboard/esc-bidirectional.fzz

 

Run this example from the command line with:

node eg/esc-bidirectional.js
const { Board, Button, ESC, Sensor } = require("johnny-five");
const board = new Board();

board.on("ready", () => {
  const esc = new ESC({
    device: "FORWARD_REVERSE",
    pin: 11
  });
  const throttle = new Sensor("A0");
  const brake = new Button(4);

  brake.on("press", () => esc.brake());

  throttle.on("change", () => {
    esc.throttle(throttle.scaleTo(esc.pwmRange));
  });
});

 

License

Copyright (c) 2012-2014 Rick Waldron waldron.rick@gmail.com Licensed under the MIT license. Copyright (c) 2015-2023 The Johnny-Five Contributors Licensed under the MIT license.