Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

blinktjs

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

blinktjs

Node.js class for the Pimoroni Blinkt!

  • 0.8.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Blinkt! class (ES6) for node.js

Control your Pimoroni Blinkt! in javascript. 8 APA102 LEDs for your Raspberry Pi https://shop.pimoroni.com/products/blinkt. Original python libraries available https://github.com/pimoroni/blinkt.

Usage

Set the pixels with setPixel() or setAll() and call draw() to write the pixels to the device.

  • setPixel(0, 255, 255, 255, 0.5); - setPixel takes the pixel number (0-7), rgb values and optionally brightness
  • setAll(255,255,255, 0.3) - sets all pixels to a color, with an optional brightness value
  • off() - turn off all lights. This calls draw() internally, as it's meant to be a single call to turn everything off.
  • rotateLeft() - shift leds to the left
  • rotateRight() - shift leds to the right
  • draw() - always call draw to write the pixel data to blinkt

Additionally, there are some startup options

  • defaultBrightness - the brightness value to use if none provided. 0.5 by default.
  • CLK - clock pin, 24 by default
  • DAT - data pin, 23 by default
  • pixelCount - number of pixels, 8 by default
  • colorFormat - 'RGB' by default, you can also use 'HSL' and 'HSV'. HSL works, but isn't connected to led brightness, so not completely usable.
  • clearOnExit - whether to call off() when the process exits. true by default.

Examples

const Blinkt = require('blinktjs');
const blinkt = new Blinkt({defaultBrightness: 0.2});

blinkt.setAll(255, 0, 0);
blinkt.draw();

See the examples folder for a few basic examples.

Keywords

FAQs

Package last updated on 25 Sep 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc