{"_id":"@dawiidio/seesaw","_rev":"2-df850d56fbedc8f96347bc274878a4e2","name":"@dawiidio/seesaw","dist-tags":{"latest":"0.1.0"},"versions":{"0.0.3":{"name":"@dawiidio/seesaw","version":"0.0.3","description":"Adafruit seesaw boards driver for node","main":"dist/index.js","scripts":{"start":"node dist/index.js","test":"echo \"Error: no test specified\"","build":"tsc & tsc-alias","build:watch":"(concurrently \"tsc -w\" \"tsc-alias -w\")"},"devDependencies":{"@types/commander":"^2.12.2","@types/dotenv":"^8.2.0","@types/i2c-bus":"^5.1.2","@types/node":"^20.11.13","concurrently":"^8.2.2","tsc-alias":"^1.8.8","typescript":"^5.3.3"},"peerDependencies":{"i2c-bus":"^5.2.3"},"repository":{"type":"git","url":"git+ssh://git@github.com/dawiidio/seesaw.git"},"keywords":["node","adafruit","seesaw","i2c","arduino"],"author":{"name":"Dawid Wojda","email":"dawid@dawiid.io","url":"https://dawiid.io/"},"private":false,"license":"ISC","publishConfig":{"access":"public"},"_id":"@dawiidio/seesaw@0.0.3","gitHead":"fe7a81db83afd54b47f7b35c6a0399680da3b075","types":"./dist/index.d.ts","bugs":{"url":"https://github.com/dawiidio/seesaw/issues"},"homepage":"https://github.com/dawiidio/seesaw#readme","_nodeVersion":"20.11.0","_npmVersion":"10.2.4","dist":{"integrity":"sha512-9vaQ9hEga3aLHLqJnQjAAnnwYpJJs1pymw+ufDQ9cj8EwgORBGsoZtmeitWgHT7aCuHnlWmhnula5IM4LYKv1Q==","shasum":"827ac72c50219145f8b1e2e66b68c3892ad178ce","tarball":"https://registry.npmjs.org/@dawiidio/seesaw/-/seesaw-0.0.3.tgz","fileCount":22,"unpackedSize":25565,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@dawiidio%2fseesaw@0.0.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCJJ4AbWOLrPCq6MvmZQJm0ZdcrS7gnkceGKcj7KhgUZwIgEhHiUhlARQSd1jFrGlOGm21+3i0QMsoGtKpepKiDW9s="}]},"_npmUser":{"name":"dawiidio","email":"dawiidio@gmail.com"},"directories":{},"maintainers":[{"name":"dawiidio","email":"dawiidio@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/seesaw_0.0.3_1707768386063_0.22890360525699438"},"_hasShrinkwrap":false},"0.0.4":{"name":"@dawiidio/seesaw","version":"0.0.4","description":"Adafruit seesaw boards driver for node","main":"dist/index.js","scripts":{"start":"node dist/index.js","test":"echo \"Error: no test specified\"","build":"tsc && tsc-alias","build:watch":"(concurrently \"tsc -w\" \"tsc-alias -w\")"},"devDependencies":{"@types/commander":"^2.12.2","@types/dotenv":"^8.2.0","@types/i2c-bus":"^5.1.2","@types/node":"^20.11.13","concurrently":"^8.2.2","tsc-alias":"^1.8.8","typescript":"^5.3.3"},"peerDependencies":{"i2c-bus":"^5.2.3"},"repository":{"type":"git","url":"git+ssh://git@github.com/dawiidio/seesaw.git"},"keywords":["node","adafruit","seesaw","i2c","arduino"],"author":{"name":"Dawid Wojda","email":"dawid@dawiid.io","url":"https://dawiid.io/"},"private":false,"license":"ISC","publishConfig":{"access":"public"},"_id":"@dawiidio/seesaw@0.0.4","gitHead":"21af306af3f1dff15f4aaeaba8500007d586ee21","types":"./dist/index.d.ts","bugs":{"url":"https://github.com/dawiidio/seesaw/issues"},"homepage":"https://github.com/dawiidio/seesaw#readme","_nodeVersion":"20.11.0","_npmVersion":"10.2.4","dist":{"integrity":"sha512-/6vcvnAS7TKIXqTTaK4fikk+9BvU1SvBTxNSqYijSLKex0yoq8jfPw0gCwSq5QmKLhmyNJ9IZhzLamOFl3dOaw==","shasum":"1cf17af26ce70e295e4a65189ab7fc50adcd33ac","tarball":"https://registry.npmjs.org/@dawiidio/seesaw/-/seesaw-0.0.4.tgz","fileCount":22,"unpackedSize":25566,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@dawiidio%2fseesaw@0.0.4","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC8AqZtXk+RpTPUmmVs64ZzYGvmrwwU3iboSwcdSPR5PwIgORGLoNmte8ZcGctD8SsHsgA2tjuUtNay0ENFQCKbQsM="}]},"_npmUser":{"name":"dawiidio","email":"dawiidio@gmail.com"},"directories":{},"maintainers":[{"name":"dawiidio","email":"dawiidio@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/seesaw_0.0.4_1707768769115_0.7772139368737243"},"_hasShrinkwrap":false},"0.1.0":{"name":"@dawiidio/seesaw","version":"0.1.0","description":"Adafruit seesaw boards driver for node","main":"dist/index.js","scripts":{"start":"node dist/index.js","test":"echo \"Error: no test specified\"","build":"tsc && tsc-alias","build:watch":"(concurrently \"tsc -w\" \"tsc-alias -w\")","build:watch:upload":"(concurrently \"tsc -w\" \"tsc-alias -w\" \"rsync-watch\")"},"devDependencies":{"@types/commander":"^2.12.2","@types/dotenv":"^8.2.0","@types/i2c-bus":"^5.1.2","@types/node":"^20.11.13","concurrently":"^8.2.2","rsync-watch":"^0.0.1","tsc-alias":"^1.8.8","typescript":"^5.3.3"},"peerDependencies":{"i2c-bus":"^5.2.3"},"repository":{"type":"git","url":"git+ssh://git@github.com/dawiidio/seesaw.git"},"keywords":["node","adafruit","seesaw","i2c","arduino"],"author":{"name":"Dawid Wojda","email":"dawid@dawiid.io","url":"https://dawiid.io/"},"private":false,"license":"ISC","publishConfig":{"access":"public"},"_id":"@dawiidio/seesaw@0.1.0","gitHead":"33dc38a4e45b797d034bd063556a60121634fa7b","types":"./dist/index.d.ts","bugs":{"url":"https://github.com/dawiidio/seesaw/issues"},"homepage":"https://github.com/dawiidio/seesaw#readme","_nodeVersion":"20.11.0","_npmVersion":"10.2.4","dist":{"integrity":"sha512-gegbv6hY2WJgnSdRkYKTF6LyrGrGJkoNo6TzMwo75sbhgEFstBmk5S8aZB+FR156YzP27Z2kvun+/by06bneww==","shasum":"72aa34ddb05b694ddb44b61459eed2626d10d6cd","tarball":"https://registry.npmjs.org/@dawiidio/seesaw/-/seesaw-0.1.0.tgz","fileCount":22,"unpackedSize":26921,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@dawiidio%2fseesaw@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEuNLk5WGMSJi18xaH49aoOEyVcXxDe7XgBE1M3pjil/AiAr04Qfe9KPE/evbKglsXG9h8nlPknY2oZyIRBya61hVA=="}]},"_npmUser":{"name":"dawiidio","email":"dawiidio@gmail.com"},"directories":{},"maintainers":[{"name":"dawiidio","email":"dawiidio@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/seesaw_0.1.0_1708263900806_0.6603755807496345"},"_hasShrinkwrap":false}},"time":{"created":"2024-02-12T20:06:25.982Z","0.0.3":"2024-02-12T20:06:26.213Z","modified":"2024-02-18T13:45:02.011Z","0.0.4":"2024-02-12T20:12:49.299Z","0.1.0":"2024-02-18T13:45:01.120Z"},"maintainers":[{"name":"dawiidio","email":"dawiidio@gmail.com"}],"description":"Adafruit seesaw boards driver for node","homepage":"https://github.com/dawiidio/seesaw#readme","keywords":["node","adafruit","seesaw","i2c","arduino"],"repository":{"type":"git","url":"git+ssh://git@github.com/dawiidio/seesaw.git"},"author":{"name":"Dawid Wojda","email":"dawid@dawiid.io","url":"https://dawiid.io/"},"bugs":{"url":"https://github.com/dawiidio/seesaw/issues"},"license":"ISC","readme":"# Seesaw\n\n[Adafruit Seesaw](https://learn.adafruit.com/adafruit-seesaw-atsamd09-breakout?view=all) boards driver for Node.js\n\nStill under heavy development, support for the rest of functionalities will be added soon.\n\n## Installation\n\n```shell\nnpm i -S @dawiidio/seesaw\n// or\nyarn add @dawiidio/seesaw\n```\n\n## Usage\n\n```ts\nimport i2c from 'i2c-bus';\nimport { Seesaw, SeesawPinMode } from '@dawiidio/seesaw';\n\nasync function main() {\n    const address = 0x49 as const;\n    const bus = await i2c.openPromisified(1);\n\n    const device = new Seesaw({\n        bus,\n        address,\n    });\n    \n    await device.detectHardware();\n    // software reset, could be skipped\n    await device.reset();\n\n    const ledPin = 15;\n    const adcPin = 2;\n    await device.pinMode(ledPin, SeesawPinMode.OUTPUT);\n    await device.pinMode(adcPin, SeesawPinMode.INPUT);\n\n    setInterval(async () => {\n        console.log('ADC >', await device.analogReadVoltage(adcPin));\n        await device.toggle(ledPin);\n    }, 1000);\n}\n\nmain();\n```\n\n## Supported functionalities\n\n- [x] Device\n- [x] Pin config\n- [x] GPIO\n- [x] ADC\n- [ ] PWM\n- [ ] UART\n- [ ] Interrupts\n- [ ] Eeprom\n- [ ] Neopixel\n- [ ] Touch buttons _(may work with basic GPIO config)_\n\n### Device\n\n#### Reset\n\ndevice software reset\n\n```ts\nawait device.reset();\n```\n\n### Pin config\n\n```ts\nimport { Seesaw, SeesawPinMode } from '@dawiidio/seesaw';\n\n//...\n\ndevice.pinMode(15, SeesawPinMode.OUTPUT);\n// or\ndevice.pinMode(15, SeesawPinMode.INPUT);\n// or\ndevice.pinMode(15, SeesawPinMode.INPUT_PULLDOWN);\n// or\ndevice.pinMode(15, SeesawPinMode.INPUT_PULLUP);\n```\n\n### GPIO\n\n#### Write\n\n```ts\nconst pinValue = true;\nawait device.digitalWrite(15, pinValue);\n```\n\n#### Read\n\n```ts\nconst pinValue: boolean = await device.digitalRead(15);\n```\n\n#### Toggle\n\n```ts\nawait device.toggle(15);\n```\n\n### ADC\n\n## Read\n\nRead raw ADC value\n\n```ts\nconst adcValue: number = await device.analogRead(2); // int\n```\n\nRead voltage\n\n```ts\nconst device = new Seesaw({\n    bus,\n    address,\n    adcRefVoltage: 3.3 // by default 3.3, if your Seesaw board runs on 5v set 5 here\n});\n\n// ...\n\n// below value will be based on voltage set in the constructor settings  \nconst adcValue: number = await device.analogReadVoltage(2); // float\n```\n\n## Supported microcontrollers\n\n- [x] Attiny8xx\n- [x] Attiny16xx\n- [x] SAMD09","readmeFilename":"README.md"}