Edo78 / ADC0832

A node.js module to manage adc0832 throug the Raspberry Pi gpio

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This module is a just a rewrite, based on rpio, of https://github.com/nkolban/nodejs-adc0832 (which is based on wiringPi)

adc0832

The adc0832 is an Integrated Circuit (IC) that performs analog to digital conversion. This module provides an encapsulation of those capabilities for the Raspberry Pi environment.

Install

To install this module you can use npm

npm install -S adc0832

Usage

In order to use the module, we must require adc0832. For example:

var adc0832 = require("adc0832");

We must also initialize the module by explicitly calling init:

adc0832.init(clk, dio, cs);

The 3 parameters are the numbers of the gpio pins linked to the IC.

To retrieve a value from the IC, we can call

adc0832.getValue(channel)

with channel being either 0 or 1. Since the adc0832 is an 8 bit adc coonverter, the value returned will be between 0 and 255.`

About

A node.js module to manage adc0832 throug the Raspberry Pi gpio

License:MIT License


Languages

Language:JavaScript 100.0%