Comments (27)
I would like to contribute to your example.
I added an on / off and reset button as well as a smooth color change and brightness.
https://github.com/Kristian8606/LED_Strip/blob/master/main.c
from esp8266-homekit-neopixel-light-strip.
@Kristian8606 Thank you for your contribution! I will have a look as soon as possible!
from esp8266-homekit-neopixel-light-strip.
change this ws2812_i2s_init(LED_COUNT, PIXEL_RGBW); and this ws2812_i2s_update(pixels, PIXEL_RGBW); int r, g, b, w;
w = LED_RGB_SCALE * i * (1 -s);
rgb->red = (uint8_t) r;
rgb->green = (uint8_t) g;
rgb->blue = (uint8_t) b;
rgb->white= (uint8_t) w;
Someone to try will this work for sk6812?
from esp8266-homekit-neopixel-light-strip.
@dbartelmus It's made for the WS2812 Integrated Light Source, so it's uses just Red, green and blue LEDs. The use for RGBW is on my todo list.
If you want to make you own start here: ESP HomeKit SDK – Full Installation
from esp8266-homekit-neopixel-light-strip.
@dbartelmus Use this https://github.com/maximkulkin/esp-homekit-demo/blob/master/examples/led_strip/led_strip.c and edit it so it fits your needs. That’s what I did.
from esp8266-homekit-neopixel-light-strip.
Thank you greatly. I will share my job later with you.
from esp8266-homekit-neopixel-light-strip.
This repository seems to support SK6812 through i2s - https://github.com/esp8266-setup/ws2812_i2s and I can see that author is using different bit patterns depending of led strand:
#if LED_TYPE == LED_TYPE_WS2812
const IRAM_DATA int16_t bitpatterns[16] = {
0b1000100010001000, 0b1000100010001110, 0b1000100011101000, 0b1000100011101110,
0b1000111010001000, 0b1000111010001110, 0b1000111011101000, 0b1000111011101110,
0b1110100010001000, 0b1110100010001110, 0b1110100011101000, 0b1110100011101110,
0b1110111010001000, 0b1110111010001110, 0b1110111011101000, 0b1110111011101110,
};
#endif
#if LED_TYPE == LED_TYPE_SK6812
static const uint16_t bitpatterns[16] = {
0b1000100010001000, 0b1000100010001100, 0b1000100011001000, 0b1000100011001100,
0b1000110010001000, 0b1000110010001100, 0b1000110011001000, 0b1000110011001100,
0b1100100010001000, 0b1100100010001100, 0b1100100011001000, 0b1100100011001100,
0b1100110010001000, 0b1100110010001100, 0b1100110011001000, 0b1100110011001100,
};
#endif
and code for ws2812_i2c that was linked above by @rmuike is from different source - it seems that this one is striped only for ws2812 strand - but I can be wrong.
On the other hand there is a function named hsi2rgb:
static void **hsi2rgb**(float h, float s, float i, ws2812_pixel_t* rgb)
and it's easy to find related one to RGBW hsi2rgbw - I'm curious if this as simple as this @rmuike?
from esp8266-homekit-neopixel-light-strip.
very interesting! am curious how you would tackle RGBW?
from esp8266-homekit-neopixel-light-strip.
I've tried to make approach for "W" (RGBW) of @Kristian8606 code customisation but without success
from esp8266-homekit-neopixel-light-strip.
The only LED strip I have is ws2812b which is rgb and does not support W.
I think the one that supports rgbw is sk6812, but I don't have one.
from esp8266-homekit-neopixel-light-strip.
Okay, that's a pity, but how would you approach it?
from esp8266-homekit-neopixel-light-strip.
I've tried this, the real deal with HomeKit is to separate RGB and White cold/White warm channel, not to mix it like the HSI to RGB method to with this code to emulate white with all colors.
This code seems to have some references for white channel, look at every commented section like: // convert HSI to RGBW and etc.
I've done all of this but even RGB is flickering some random color not to mention that I don't get separate white channel like this:
from esp8266-homekit-neopixel-light-strip.
Try to build this, I think this comes originally from @Kristian8606 fork
main.c.zip
This is with uncommented and adapted (I think) for RGBW but I'm not sure how HomeKit API works
from esp8266-homekit-neopixel-light-strip.
So this is output on sk6812 from main.c which I've attached - despite wifi.h and defining pass and ssid, you still need to connect manually device to your network and then add it to HomeKit, pin-code is 1111-111-111.
Colors are messed up, what's up with that? But it's stable
from esp8266-homekit-neopixel-light-strip.
I understand that there are several types of sk6812 rgb and rgbw you need to be sure yours is rgbw
from esp8266-homekit-neopixel-light-strip.
LED_COUNT must match your pixels count
from esp8266-homekit-neopixel-light-strip.
from esp8266-homekit-neopixel-light-strip.
change this ws2812_i2s_init(LED_COUNT, PIXEL_RGBW); and this ws2812_i2s_update(pixels, PIXEL_RGBW); int r, g, b, w;
w = LED_RGB_SCALE * i * (1 -s); rgb->red = (uint8_t) r; rgb->green = (uint8_t) g; rgb->blue = (uint8_t) b; rgb->white= (uint8_t) w;
Someone to try will this work for sk6812?
Tested with a RGBW stip and It works!
from esp8266-homekit-neopixel-light-strip.
is it possible to make a video because soon i will not have such an LED strip
from esp8266-homekit-neopixel-light-strip.
Here's your proof of concept!
IMG_1249.mov.zip
from esp8266-homekit-neopixel-light-strip.
It does, goes nicely with Siri :)
from esp8266-homekit-neopixel-light-strip.
SK6812 LED Strip RGBW With ESP under HOMEKIT - main.bin.zip
compiled bin for tests - id has some bugs like changing name and first time parity problem, and connection is overall slow BUT working.
from esp8266-homekit-neopixel-light-strip.
It works but the white channel is not in use when you set it to white.
This is what it is supposed to look like.
from esp8266-homekit-neopixel-light-strip.
@rmuike should it not be only white, when its set to white? Thats the point of rgbw, right?
@AchimPieters Any news on RGBW/SK6812 support?
from esp8266-homekit-neopixel-light-strip.
from esp8266-homekit-neopixel-light-strip.
well... i do :D
from esp8266-homekit-neopixel-light-strip.
from esp8266-homekit-neopixel-light-strip.
Related Issues (2)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esp8266-homekit-neopixel-light-strip.