我尝试通过 apt 安装 MRAA 并从其 github 源代码构建它。我可以在命令行上运行 mraa-gpio 和 mraa-i2c,并且可以使用 GPIO javascript 示例打开和关闭 LED。但是,当我尝试运行 SPI javascript 示例时,我在实例化时收到错误:
(classic)thosmos@localhost:~/hello-node$ sudo nodejs
> var m = require('mraa');
undefined
> x = new m.Spi(0)
Error: Illegal arguments for construction of _exports_Spi
at Error (native)
at repl:1:5
at REPLServer.defaultEval (repl.js:252:27)
at bound (domain.js:287:14)
at REPLServer.runBound [as eval] (domain.js:300:12)
at REPLServer.<anonymous> (repl.js:417:12)
at emitOne (events.js:82:20)
at REPLServer.emit (events.js:169:7)
at REPLServer.Interface._onLine (readline.js:210:10)
at REPLServer.Interface._line (readline.js:549:8)
>
我是否缺少了某个步骤才能使其正常工作?