Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
76 lines (38 sloc) 1.08 KB

Servo - Prompt

Servo on pin 10

Servo connected to pin 10. Requires servo on pin that supports PWM (usually denoted by ~).


Fritzing diagram: docs/breadboard/servo.fzz


Run this example from the command line with:

node eg/servo-prompt.js
const {Board, Servo} = require("johnny-five");
const readline = require("readline");

const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout

const board = new Board();

board.on("ready", () => {
  const servo = new Servo(10);

  rl.setPrompt("SERVO TEST (0-180)> ");

  rl.on("line", (line) => {;
  }).on("close", () => process.exit(0));



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.