@nanomatic/ncp5623b
v2.0.5
Published
RGB LED driver via I²C (NCP5623B) for the Raspberry PI 4 on Linux Ubuntu
Downloads
3
Maintainers
Readme
📝 Table of Contents
🏁 Getting Started
Installing
npm i @nanomatic/ncp5623b
Using
Example code below:
import { NCP5623B } from '@nanomatic/ncp5623b'
// Create new NCP5623B object
const led = new NCP5623B;
const random = () => Math.floor(Math.random() * 101);
/*
Setting gamma correction. Values:
g < 0 forbidden
g = 0 max
g < 1 brighter
g = 1 linear
g > 1 darker
*/
// led.setGamma('r', 1);
led.setGamma('g', 2.5);
// led.setGamma('b', 1);
// console.log(led.getGamma());
// Set random color every 500ms
setInterval(() => led.set(random(), random(), random()), 500);
// Change color in interval
// let i = 0;
// setInterval(() => led.set(0, 0, i++ % 100), 20);
⛏️ Built With
- @types/rpio - Type definitions for the Raspberry I/O library
- ts-node-dev - TypeScript Node Dev
- tsc-watch - The nodemon for TypeScript
- TSLint - TypeScript linter
- NodeJs - Test Environment
📦 Dependencies
- rpio - Raspberry I/O library
✍️ Authors
- @NANOmatic - Idea & Initial work
🎉 Acknowledgments
- Special thanks for Łukasz for working together and giving ideas 😉