วินโดวส์ 10, อาร์ดูโน่ ไมโคร เดิมทีฉันใช้บทช่วยสอน "Blink.js" มาตรฐาน แต่ Johnny-Five ยังคงเชื่อมต่อกับพอร์ตอนุกรมที่ไม่ถูกต้อง ฉันฮาร์ดโค้ดพอร์ต COM ของฉัน (ในกรณีนี้คือพอร์ต 8) และผ่านข้อผิดพลาดเริ่มต้นไปแล้ว แต่ข้อผิดพลาดใหม่ทำให้ฉันหยุดตาย ผลลัพธ์ของฉันมีลักษณะเช่นนี้:
C:\Users\...\folder>node Blink.js
1536475383667 Connected COM 8
1536475383673 Error Opening COM 8: File not found
(node:12700) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Uncaught, unspecified "error" event. ([object Object])
1536475393671 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;
^
Error: Uncaught, unspecified "error" event. ([object Object])
at Board.emit (events.js:163:17)
at Board.log (C:\Users\...\folder\node_modules\johnny-five\lib\board.js:648:8)
at Board.(anonymous function) [as error] (C:\Users\...\folder\node_modules\johnny-five\lib\board.js:659:14)
at Board.<anonymous> (C:\Users\...\folder\node_modules\johnny-five\lib\board.js:395:14)
at ontimeout (timers.js:386:14)
at tryOnTimeout (timers.js:250:5)
at Timer.listOnTimeout (timers.js:214:5)
ฉันได้ทำสิ่งที่ชัดเจนทั้งหมดที่พวกเขาแนะนำแล้ว: แฟลชเฟิร์มแวร์อีกครั้ง, เบิร์น bootloader, ติดตั้งโหนดและ npm ใหม่, ทำตามคำแนะนำการติดตั้งสำหรับ Arduino ทีละขั้นตอน แม้ว่าฉันจะต้องผลักดัน StandardFirmataPlus .ino ผ่าน GUI แทนบรรทัดคำสั่ง เนื่องจาก Windows ไม่มีเครื่องมือบรรทัดคำสั่งสำหรับ Arduino โดยกำเนิด รหัสของฉันหากสร้างความแตกต่างจะมีลักษณะดังนี้:
var five = require("johnny-five"),
board, led;
board = new five.Board({port: "COM 8"});
board.on("ready", function() {
console.log('ready');
led = new five.Led(8); //This would be port 13 on most, but the Micro doesn't have that port
led.strobe(100);
});
ฉันดิ้นรนมานานแล้วเพื่อรับการตอบสนองจาก Arduino โดยใช้ Johnny-Five และความช่วยเหลือใดๆ ก็ตามจะได้รับการชื่นชมอย่างมาก