Skip to content

Commit

Permalink
housekeeping
Browse files Browse the repository at this point in the history
  • Loading branch information
johntalton committed Mar 28, 2024
1 parent 0140e85 commit 5dd226b
Show file tree
Hide file tree
Showing 5 changed files with 131 additions and 252 deletions.
142 changes: 0 additions & 142 deletions .eslintrc.json

This file was deleted.

6 changes: 2 additions & 4 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"
interval: "weekly"
assignees:
- "octocat"
commit-message:
Expand All @@ -14,7 +12,7 @@ updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
interval: "weekly"
assignees:
- "octocat"
commit-message:
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# mcp300X

Implemntation of the mcp3004/mcp3008 ADC chip.
Implementation of the mcp3004/mcp3008 ADC chip.

[![npm Version](https://img.shields.io/npm/v/@johntalton/mcp300x.svg)](https://www.npmjs.com/package/@johntalton/mcp300x)
![GitHub package.json version](https://img.shields.io/github/package-json/v/johntalton/mcp300x)
Expand All @@ -11,25 +11,25 @@ Implemntation of the mcp3004/mcp3008 ADC chip.
[![Package Quality](https://npm.packagequality.com/shield/%40johntalton%2Fmcp300x.svg)](https://packagequality.com/#?package=@johntalton/mcp300x)

Features:
- Provides access to pseudo differential mode
- Provides access to pseudo differential mode
- Does not assume Vref and Vin are the same

And while this implementation is more verbose, it does so in order to aid in clarity of understanding and for learning.

## Sample Usage

```javascript
const cp300X = require('@johntalton/mcp300X');
import { mcp300x } = from '@johntalton/mcp300X'
const spi = ...
const adc = mcp300X.from({ bus: spi, Vref: 5, channels: 8 })

const adc = await mcp300X.adc({ bus: spi, Vref: 5, channels: 8 })
const result = await dev.readADC(channel)

console.log('normalized value', result.normal)
console.log('voltage', result.V)
```

In the usage above our Analog circitry is running at 5V, while the chip is running at 3.3V configuration.
In the usage above our Analog circuitry is running at 5V, while the chip is running at 3.3V configuration.

The returned ```result``` object holds the ```normal```-ized value, as well as the ```raw``` ADC value and the ```V``oltage as calculated.

Expand All @@ -53,6 +53,6 @@ From the spec:

```
...
dev.readADCDiff(6).then(result => { ... }) // index-channel 6 or +Ch5 / -Ch4
dev.readADCDiff(6).then(result => { ... }) // index-channel 6 or +Ch5 / -Ch4
```

37 changes: 33 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"name": "@johntalton/mcp300X",
"version": "1.0.0",
"version": "2.0.0",
"description": "",
"type": "module",
"main": "src/mcp300X.js",
"scripts": {
"lint": "./node_modules/.bin/eslint ."
"lint": "eslint ."
},
"repository": {
"type": "git",
Expand All @@ -15,7 +16,35 @@
"dependencies": {
},
"devDependencies": {
"eslint": "^7.3.1",
"mqtt": "^4.1.0"
"eslint": "^8.0.0",
"mqtt": "^5.5.0",
"@johntalton/eslint-config": "github:johntalton/eslint-config"
},
"eslintConfig": {
"extends": [
"eslint:recommended",
"@johntalton/eslint-config/es"
],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"env": {
"es6": true
},
"ignorePatterns": [
"test/**",
"examples/**/*"
],
"rules": {
"no-magic-numbers": "off",
"semi": "warn",
"max-len": [
"error",
{
"code": 120
}
]
}
}
}
Loading

0 comments on commit 5dd226b

Please sign in to comment.