我以前让我的 Arduino 套件在与 Breakout 相同的硬件上工作,但想切换到Johnny Five。我的硬件与来自http://weblog.bocoup.com/javascript-arduino-programming-with-nodejs/的简单单 LED 布局连接,但运行基本 LED 频闪演示无法按预期工作:
var five = require("johnny-five"),
board, led;
board = new five.Board();
board.on("ready", function() {
console.log('ready');
led = new five.Led(13);
led.strobe(100);
});
回报:
1341154189666 Board Connecting...
1341154189697 Serial Found possible serial port cu.usbmodem621
1341154189699 Board -> Serialport connected cu.usbmodem621
1341154191570 Repl Successfully Connected
我在没有 LED 频闪的情况下直接进入 Firmata REPL,并且board.ready
是false
.
关于为什么 board.ready 回调不会触发的任何建议?