@nanomatic/ncp5623b
TypeScript icon, indicating that this package has built-in type declarations

2.0.5 • Public • Published

NCP5623B

@nanomatic/ncp5623b

Status License


RGB LED driver via I²C (NCP5623B) for the Raspberry PI 4 on Linux Ubuntu.

📝 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

📦 Dependencies

  • rpio - Raspberry I/O library

✍️ Authors

🎉 Acknowledgments

  • Special thanks for Łukasz for working together and giving ideas 😉

Package Sidebar

Install

npm i @nanomatic/ncp5623b

Homepage

nanomatic.pl

Weekly Downloads

0

Version

2.0.5

License

MIT

Unpacked Size

5.88 kB

Total Files

4

Last publish

Collaborators

  • nano_matic