I'm running through the BeagleBone examples for the AI, but the ones that attempt to read or write to pins throw errors in both Python and bonescript.
Here is the output from analoginout.js:
Hit ^C to stop
info: No pinmux for P9_14
fs.js:733
var r = binding.read(fd, buffer, offset, length, position);
^
Error: ETIMEDOUT: connection timed out, read
at Error (native)
at Object.fs.readSync (fs.js:733:19)
at tryReadSync (fs.js:488:20)
at Object.fs.readFileSync (fs.js:528:19)
at Object.readAIN (/usr/local/lib/node_modules/bonescript/src/hw_mainline.js:287:30)
at Object.f.analogRead (/usr/local/lib/node_modules/bonescript/src/index.js:330:19)
at Timeout.loop [as _onTimeout] (/var/lib/cloud9/BeagleBone/AI/analogInOut.js:23:19)
at ontimeout (timers.js:386:11)
at tryOnTimeout (timers.js:250:5)
at Timer.listOnTimeout (timers.js:214:5)
Is there a config I need to do first? I see other's in the world with this issue on older BeagleBone's and the responses vary considerably.
This is the code:
const b = require('bonescript'); const inputPin = "A3"; const outputPin = "P9_14"; console.log('Hit ^C to stop'); b.pinMode(outputPin, b.ANALOG_OUTPUT); setTimeout(loop, 200); // work-around to wait for PWM permissions function loop() { var value = b.analogRead(inputPin); process.stdout.write(inputPin + '-->' + outputPin + ': ' + (value*100).toFixed(1) + '% \r'); b.analogWrite(outputPin, value); setTimeout(loop, 10); }
Thanks,
Sean