Run this example from the command line with:
node eg/stepper-sweep.js
const {Board, Stepper} = require("johnny-five");
const board = new Board();
board.on("ready", () => {
/**
* In order to use the Stepper class, your board must be flashed with
* either of the following:
*
* - AdvancedFirmata https://github.com/soundanalogous/AdvancedFirmata
* - ConfigurableFirmata https://github.com/firmata/arduino/releases/tag/v2.6.2
*
*/
const stepper = new Stepper({
type: Stepper.TYPE.DRIVER,
stepsPerRev: 200,
pins: [11, 12]
});
stepper.rpm(180).ccw().step(2000, () => console.log("done"));
});
Copyright (c) 2012-2014 Rick Waldron [email protected] Licensed under the MIT license. Copyright (c) 2015-2023 The Johnny-Five Contributors Licensed under the MIT license.