const five = require('johnny-five'); const board = new five.Board(); board.on('ready', function() { const led = new five.Led(13); setInterval(function() { led.toggle(); }, 500); });
const five = require('johnny-five'); const board = new five.Board(); board.on('ready', function() { const servo = new five.Servo(9); servo.to(90); board.wait(1000, function() { servo.stop(); }); });In this example, the Board object is created and waits for the 'ready' event before initializing the servo motor and moving it to 90 degrees. Then, the wait method is invoked on the Board object, which pauses the execution for 1 second before stopping the servo motor. The johnny-five package library is used in this example as well.