Skip to content

Analog to Digital conversion with ADS1255 and ADS1256

License

Notifications You must be signed in to change notification settings

CenturyGIS/ADS125x

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ADS125x

Analog to Digital conversion with ADS1255 and ADS1256. Tested with Raspberry Pi 3 and Waveshare High-Precision AD/DA Board (which uses the ADS1256). The concept for this library was largely borrowed from PiPyADC;

Usage

import { ADS125x } from 'ads125x';

const config = {
  drdyPin: 17,
  resetPin: 18,
  pdwnPin: 27,
  csPin: 22,
  spiChannel: 1,
};

const a = new ADS125x(config);
a.calibrateSelf()
  .then(() => a.wakeup());

To read values from a channel, call the read function with the specified channel configuration. The following examples uses the 0 channel for the positive reading and the "Analog Input Common" for negative. See the datasheet for more information.

const POS_AIN0   = 0x00;
const NEG_AINCOM = 0x08;

const v = a.read(POS_AIN0 | NEG_AINCOM)
  .then(output => console.info(output));

Test

npm test

About

Analog to Digital conversion with ADS1255 and ADS1256

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •