-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reading from Analog > Digital #46
Comments
The MCP3008 is an SPI device but Johnny-Five and Raspi-IO currently don't support SPI devices. What should work is the PCF8591 which is an I2C device. I2C is supported. See http://johnny-five.io/examples/expander-PCF8591/ |
See also rwaldron/io-plugins#3 |
Hmm tried using node-spi from @RussTheAerialist as mentioned in that thread but getting issues on the install with node-gyp: russtheaerialist-retired-projects/node-spi#25 I'll order a PCF8591, and if there are any other ideas of things to try with the MCP3008, let me know - thanks!! |
@nick-jonas what version of Node.js are you using? https://github.com/RussTheAerialist/node-spi supports v0.10 and v0.12, but not v4 or higher |
@fivdi v0.10.36 |
Hi @nick-jonas! Just so you're aware, using node-spi and this SPI device won't make the analog data available to Johnny-Five. You can certainly still use it, but you'll have to parse the SPI data yourself, and wire up your own event logic independent of Johnny-Five :( If at all possible, I'd recommend going with the I2C backpack that @fivdi mentioned. |
I believe the issue was addressed in the previous comments. If there is still an issue that needs to be fixed, feel free to reopen. |
I'm trying to read data from 2x10k potentiometers that are wired to the 1st two inputs of an MCP3008, and then the MCP3008 is hooked up to the RPi like this:
(rpi on the left, mcp3008 on the right):
Pin 19 (MOSI / #10) -> pin 11 (Din)
Pin 21 (MISO / #9) -> pin 12 (Dout)
Pin 23 (SCKL / #11) -> pin 13 (CLK)
Pin 24 (CD0 / #8) -> pin 10 (CS)
Pin 6 (GND) -> pin 14 (AGND) & 9 (DGND)
How do I go about doing this? The only reference code I could find on johnny-five is for the Grove shield and Edison board:
How do I create two rotary instances (what would I use for the GPIO pins)?
The text was updated successfully, but these errors were encountered: