Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
A Node.js library for an ADS1015 analog to digital converter
Theses are super inexpensive on amazon!
(Converting analog joystick input and displaying on an ssd1327)
The joystick is: here
The display is: here
--> Also checkout my node module for it!: here
// const connection = [1, 0x48, 'i2c-bus']
// use an `i2cdriver` board for development!...
const connection = ['/dev/tty.usbserial-DO010000', 0x48, 'i2cdriver/i2c-bus']
ADS1015.open(...connection).then(async (ads1015) => {
ads1015.gain = 1
for (let i = 0; i < 1000; i++) {
let x = await ads1015.measure('0+GND')
let y = await ads1015.measure('1+GND')
console.log(x, y)
}
})
Or, use with an existing bus instance:
const ADS1015 = require('ads1015')
const i2c = require('i2c-bus')
i2c.openPromisified(1).then(async (bus) => {
const ads1015 = await ADS1015(bus)
// ads1015.gain = 1
for (let i = 0; i < 1000; i++) {
let value = await ads1015.measure('0+GND')
console.log(value)
}
})
https://npmjs.com/package/ads1015
npm install ads1015 i2c-bus
To prevent multiple instances of i2c-bus being installed in your project- it is NOT included as a dependency. You just need to install it separately.
This also allows you to swap in a different bus, such as an i2cdriver if desired.
Creates an ADS1015 instance using and existing bus
object.
Opens an i2c bus and creates a new ads1015
instance.
busNum
- The bus to open
addr
- The address of the ads1015 device
provider
- The i2c module to use to open the bus. (default i2c-bus)
The module must conform to the i2c-bus@^5.0.0 interface.
TIP! Try an i2cdriver for development!
Gets or sets the gain. You can use a Number
or String
.
Valid values:
2/3
= +/- 6.144V (default)
1
= +/- 4.096V
2
= +/- 2.048V
4
= +/- 1.024V
8
= +/- 0.512V
16
= +/- 0.256V
Requests a single measurement.
Valid values for mux
parameter:
'0+1'
= Differential measurement between A0 & A1
'0+3'
= Differential measurement between A0 & A3
'1+3'
= Differential measurement between A1 & A3
'2+3'
= Differential measurement between A2 & A3
'0+GND'
= Single-ended measurement on A0
'1+GND'
= Single-ended measurement on A1
'2+GND'
= Single-ended measurement on A2
'3+GND'
= Single-ended measurement on A3
MIT
FAQs
A Node.js library for an ads1015 analog to digital converter
The npm package ads1015 receives a total of 1 weekly downloads. As such, ads1015 popularity was classified as not popular.
We found that ads1015 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.