I2C access with Node.js
Find a file
dependabot[bot] 623106c3bd
Bump minimatch from 3.0.4 to 3.1.2
Bumps [minimatch](https://github.com/isaacs/minimatch) from 3.0.4 to 3.1.2.
- [Release notes](https://github.com/isaacs/minimatch/releases)
- [Commits](https://github.com/isaacs/minimatch/compare/v3.0.4...v3.1.2)

---
updated-dependencies:
- dependency-name: minimatch
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-09 05:34:09 +00:00
.github/workflows chmod -x 2022-04-02 12:55:48 +09:00
.husky husky, lint-staged, prettier 導入によるコミット時の自動フォーマット (#38) 2021-12-08 23:03:28 +09:00
docs chore: yarn docs 2022-04-02 12:57:25 +09:00
.eslintrc.yml husky, lint-staged, prettier 導入によるコミット時の自動フォーマット (#38) 2021-12-08 23:03:28 +09:00
.gitignore chore: use prepare 2021-02-06 17:30:53 +09:00
.lintstagedrc.yaml husky, lint-staged, prettier 導入によるコミット時の自動フォーマット (#38) 2021-12-08 23:03:28 +09:00
index.ts TSDoc (#46) 2022-04-02 12:52:59 +09:00
LICENSE Create LICENSE 2019-10-18 22:02:46 +09:00
package.json 1.1.28 2023-04-09 05:33:44 +00:00
README.md chore(README): README ドキュメント追加 (#54) 2023-02-17 16:01:14 +09:00
renovate.json chore: remove :maintainLockFilesWeekly 2021-02-06 17:35:05 +09:00
tsconfig.eslint.json Feature/lint (#33) 2021-03-28 17:31:45 +09:00
tsconfig.json enable noFallthroughCasesInSwitch 2020-02-12 02:41:06 +09:00
typedoc.json TSDoc (#46) 2022-04-02 12:52:59 +09:00
yarn.lock Bump minimatch from 3.0.4 to 3.1.2 2023-04-09 05:34:09 +00:00

node-web-i2c

I2C access with Node.js

Usage

const { requestI2CAccess } = require("node-web-i2c");
const ADT7410 = require("@chirimen/adt7410");

const ADT7410_ADDR = 0x48;

async function main() {
  const i2cAccess = await requestI2CAccess();
  const port = i2cAccess.ports.get(1);
  const adt7410 = new ADT7410(port, ADT7410_ADDR);
  await adt7410.init();
  const temperature = await adt7410.read();
  console.log(`Temperature: ${temperature} ℃`);
}

main();

Document

Reference