sandeepmistry / node-chip-io

Johnny-Five IO Plugin for the Next Thing Co. C.H.I.P.
MIT License
96 stars 28 forks source link

analogRead is not a function #54

Closed ohpauleez closed 7 years ago

ohpauleez commented 7 years ago

First and foremost, thank you for all the effort you've put into this project.

When hooking up an FSR to the chip, I reached for J5's generic Sensor type (same general setup as found in the docs) - plugged into XIO-P0 and the setup like let fsr = new five.Sensor({pin: "XIO-P0", freq: 25});.

This results in error, "TypeError: this._chips[pinData.chip].analogRead is not a function" coming from here, triggered by J5's sensor support -- johnny-five/lib/sensor.js:104.

Any thoughts on why this might be happening? Anything I can do to help out? Need any additional information?

I'm using Node 8, latest versions of chio-io and johnny-five, kernel 4.4 GUI, and I have the first generation CHIP (with the 4Gb Flash).

rwaldron commented 7 years ago

According to the readme there is only one pin that supports Analog input: LRADC

ohpauleez commented 7 years ago

Gah, thanks @rwaldron! Sorry about the noise. Works like a charm.

If there's anything I can ever do to help out this project or J5, please reach out!

rwaldron commented 7 years ago

No problem ❤️