-5

运行程序 (node Alarm_system.js) 时,会出现以下输出:

λ node Alarm_system.js
1514314162653 Available COM4,COM7,COM1,COM5,COM3
1514314162670 Connected COM4
1514314162673 Error Opening COM4: Unknown error code 1167
(node:4804) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Uncaught, unspecified "error" event. ([object Object])
1514314172672 Device or Firmware Error A timeout occurred while connecting to the Board.

Please check that you've properly flashed the board with the correct firmware.
See: https://github.com/rwaldron/johnny-five/wiki/Getting-Started#trouble-shooting

If connecting to a Leonardo or Leonardo clone, press the 'Reset' button on the board, wait approximately 11 seconds for complete reset, then run your program again.
events.js:165
      throw err;
4

1 回答 1

1

您只需配置正确的端口,如下所示:

board = new five.Board({
  port: "COM7"
});

之前的代码:

board = new five.Board();

我只需要指定一个正确的端口并获得一个正确的端口,您可以使用 Arduino IDE。这是一个很好的网站:ardunino setup project

于 2017-12-26T16:28:44.547 回答