get_started_with_respeaker icon indicating copy to clipboard operation
get_started_with_respeaker copied to clipboard

node mraa lib

Open wirsing opened this issue 5 years ago • 0 comments

Which version is your board?

ReSpeaker Core v2

I'm currently trying to get the LED's to work through node using the mraa node library but am running into trouble.

Here is my code:

const mraa = require('mraa'); //require mraa
let power = new mraa.Gpio(12); //setup digital read on pin 12
power.dir(mraa.DIR_OUT); //set the gpio direction to output
power.write(1);

And here is the output:

let power = new mraa.Gpio(12); //setup digital read on pin 12
            ^
Error: Illegal arguments for construction of _exports_Gpio
    at Error (native)
    at Object.<anonymous> (/home/respeaker/led_custom/index.js:9:13)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:390:7)
    at startup (bootstrap_node.js:150:9)

Using node 6.10.3

Any idea why the node version would throw this error? I tried running as root as well with no success.

wirsing avatar Nov 01 '19 20:11 wirsing