Giter Club home page Giter Club logo

edsoft_sk6812's Introduction

EdSoft_SK6812

Arduino library for SK6812 based 4-channel RGBW LEDs.
The NeoPixel library from Adafruit can also be used to drive these LEDs but is larger in size and for my projects only a few of its functionalities are needed.
The function names are comparable with Neopixel.
The assembler source that drives WS2812 LEDs made by Tim ([email protected]) was used with a few modifications.
In version V1.1.0 the pulse frequency was increased from 800 kHz to 1050 khz.

void fill(RGBW RGBWColor, uint16_t FirstLed, uint16_t NoofLEDs);
void fill(uint32_t RGBWColor, uint16_t FirstLed, uint16_t NoofLEDs);
void setBrightness(uint16_t Bright);
void setPixelColor(uint16_t i, RGBW RGBWColor);
void setPixelColor(uint16_t i, uint32_t RGBWColor);
void show(void);
uint8_t getwhite(uint32_t c);
uint8_t getred( uint32_t c);
uint8_t getgreen(uint32_t c);
uint8_t getblue( uint32_t c);
uint32_t getPixelColor(uint16_t index);
uint32_t makeRGBWcolor( uint32_t Red, uint32_t Green, uint32_t Blue, uint32_t White);

Usage

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

Example

#include <EdSoft_SK6812.h>
EdSoft_SK6812 LED(4, 5); // EdSoft_SK6812LED(NUM_LEDS, LED_PIN);
uint32_t color1 = 0X000000FF; // 0xWWRRGGBB

void setup()
{ // LED.fill(RGBWColor, FirstLed, NoofLEDs );
LED.fill(color1, 1, 5 ); // Fill LEDs 2,3 and 4 with color1
}

void loop()
{
LED.setPixelColor(0, {0, 0, 0, 255}); // Set second LED to white (using only W channel)
LED.show(); // Send the values to the LEDs
delay(500);

LED.setPixelColor(0, 0X00FF00FF); // Set second LED to white (using only RGB channels)
LED.show();
delay(500);
}

IMG_7428
Pulse frequncy in version V1.1.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.