Comments (7)
Thanks for your advice. I will adapt the formula to work with the photocell.
from mcp-spi-adc.
The README was updated mentioning that SPI must be enabled to use mcp-spi-adc. See 33ed477.
from mcp-spi-adc.
It looks like SPI hasn't been enabled. If a Raspberry Pi is being used, which appears to be the case, then SPI can be enabled with the raspi-config
tool which can be called from the command line with the following command:
sudo raspi-config
Navigate to "5 Interfacing Options >> P4 SPI" and answer the question "Would you like the SPI interface to be enabled?" with "Yes", then answer "Ok", then answer "Finish".
If a fairly recent version Raspbian is being used a reboot should not be necessary. On an older version of Raspbian a reboot will be necessary.
After SPI has been enabled it should work.
This should be mentioned in the README.
from mcp-spi-adc.
Thanks for your straight answer!
I have enabled SPI through
sudo raspi-config
command and everything works great now.
from mcp-spi-adc.
That's good news 😄
I'll leave this issue open as a reminder that a note should be added to the README saying that SPI needs to be enabled before it can work.
One additional point, your program contains the following line of code:
console.log((reading.value * 3.3 - 0.5) * 100);
The formula (reading.value * 3.3 - 0.5) * 100
is for a TMP36 temperature sensor so it will need to be changed for a photocell.
from mcp-spi-adc.
Sorry to re-open this, but I am using an MCP3004 and am getting this when trying to read channels 0, 1, and 2. When reading channel 0 and 1, there are no issues, but reading all 3 produces this error.
from mcp-spi-adc.
@amcelroy I can't reproduce the error. Please open a new issue containing the following information:
- A description of the problem
- The complete stack trace for the EPERM error
- Minimal but complete sample code that can be used to reproduce the error
from mcp-spi-adc.
Related Issues (16)
- Typescript interface?
- Error: ENOENT, No such file or directory HOT 7
- Troubleshooting basic setup HOT 5
- No signal from Pulse Sensor HOT 22
- bindings.js: 202 Uncaught TypeError: exists is not a function HOT 2
- support for MCP3201 HOT 1
- MCP3208 differential mode HOT 1
- Error Message HOT 3
- Incompatibility with electron because of non-context-aware-ness
- Promises api HOT 1
- Drop support for Node.js v0.10, v0.12, v5 and v7 HOT 1
- Support for TI ADS1256 HOT 3
- Moisture sensor returns data between 0.78 (dry) and 0.54 (wet) HOT 1
- What's the different between device number and bus number? HOT 1
- Max sampling rate? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mcp-spi-adc.