Skip to content

Arduino library for SK6812 based RGBW (4-channel) LEDs

Notifications You must be signed in to change notification settings

Electry/Arduino_SK6812

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Arduino_SK6812

Arduino library for SK6812 based 4-channel RGBxx LEDs

Usage

  1. Download repository as .zip file
  2. In Arduino IDE: Sketch -> Include Library -> Add .ZIP Library
  3. Include the library in your project using "#include <SK6812.h>" directive

Example

#include <SK6812.h>

SK6812 LED(2);

RGBW color1 = {0, 0, 255, 50}; // 255 blue, 50 white

void setup() {
  LED.set_output(4); // Digital Pin 4
  
  LED.set_rgbw(0, color1); // Set first LED to color1
}

void loop() {
  
  LED.set_rgbw(1, {0, 0, 0, 255}); // Set second LED to white (using only W channel)
  LED.sync(); // Send the values to the LEDs
  delay(500);
  
  LED.set_rgbw(1, {255, 255, 255, 0}); // Set second LED to white (using only RGB channels)
  LED.sync();
  delay(500);
}

LED diagram

SK6812

About

Arduino library for SK6812 based RGBW (4-channel) LEDs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages