Confidential guide on numerology and astrology, based of GG33 Public information

mcp3008.js
用于查询MCP3008模拟/数字转换器的Node.js模块。
3 years
Works with Finder
0
Github Watches
6
Github Forks
23
Github Stars
mcp3008.js
A node.js module for interfacing the MCP3008 analog/digital converter.
The same instance of the module can control all eight channels on the converter.
Installation
$ npm install mcp3008.js
Usage
Here's a short example:
var Mcp3008 = require('mcp3008.js'),
adc = new Mcp3008(),
channel = 0;
adc.read(channel, function (value) {
doSomethingToValue(value);
});
Interface
Constructor
new Mcp3008([device]);
Device defaults to /dev/spidev0.0
.
Reading
instance.read(channel, callback);
This will read the value on channel
and send it to callback
.
Polling
instance.poll(channel, interval, callback);
This will read the value on channel
every interval
milliseconds and send it to callback
. Use instance.stop(channel)
to stop it.
Tear down
instance.close();
This will release the device and stop polling (if any).
相关推荐
Take an adjectivised noun, and create images making it progressively more adjective!
Reviews

user_aYRIlacv
As a dedicated user of mcp3008.js, I can confidently say that this library by fiskeben is an excellent tool for working with the MCP3008 ADC in Node.js. It simplifies the process and offers great documentation on GitHub. If you're looking for a reliable and straightforward way to interface with the MCP3008, this is the best solution available. Highly recommended!