I2C access with Node.js
Find a file
2023-08-26 00:12:22 +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 chore(deps): update dependency typedoc to ^0.25.0 2023-08-26 00:12:22 +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 chore(deps): update dependency typedoc to ^0.25.0 2023-08-26 00:12:22 +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