SaikoLED fade demo using the HSI2RGBW_PWM libary
Dependencies: HSI2RGBW_PWM mbed
HSI to RGBW demo with direct PWM output
Code and library based on SaikoLED code :
https://github.com/saikoLED/MyKi/blob/master/myki_16_bit_random_fade/myki_16_bit_random_fade.ino
https://github.com/saikoLED/MyKi/blob/master/myki_16_bit_fade/myki_16_bit_fade.ino
http://blog.saikoled.com/post/44677718712/how-to-convert-from-hsi-to-rgb-white
Diff: main.cpp
- Revision:
- 3:afa2c73359fa
- Parent:
- 0:562d0087dd7f
--- a/main.cpp Mon Dec 30 11:26:47 2013 +0000 +++ b/main.cpp Sun Feb 02 14:54:55 2014 +0000 @@ -90,6 +90,8 @@ void primary_colors() { printf("briefly show RED - GREEN - BLUE using hsi2rgbw.\r\n"); + color.s = 1; + color.i = 1; for (color.h = 0 ; color.h < 360 ; color.h += 120) { led.hsi2rgbw(color.h, color.s, color.i); @@ -99,6 +101,8 @@ void cycle_rgbw() { float rgbw[4] = {0,0,0,0}; + color.s = 1; + color.i = 1; printf("briefly show RED - GREEN - BLUE - WHITE using direct PWM output.\r\n"); rgbw[0] = 1.0f; led.pwm(rgbw); @@ -129,7 +133,6 @@ } void setup() { - led.colorMode(RGBW); color.h = 0; color.s = maxsaturation; color.i = 0; @@ -163,3 +166,4 @@ wait_ms(steptime); } } +