board.on("ready", function() { // Create a new `motor` hardware instance. motor = new five.Motor({ pin: 10 }); board.repl.inject({ motor: motor }); // "start" events fire when the motor is started. motor.on("start", function( err, timestamp ) { console.log( "start", timestamp ); // Demonstrate motor stop in 2 seconds board.wait( 5000, function() { motor.stop(); }); }); // "stop" events fire when the motor is started. motor.on("stop", function( err, timestamp ) { console.log( "stop", timestamp ); }); //motor.start(); web(motor); });
board.wait( 5000, function() { motor.stop(); });