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
Revision 3:afa2c73359fa, committed 2014-02-02
- Comitter:
- frankvnk
- Date:
- Sun Feb 02 14:54:55 2014 +0000
- Parent:
- 2:34b0063fab4c
- Commit message:
- New library - auto detect RGBW mode.
; S and I parameters correctly initialized.
Changed in this revision
HSI2RGBW_PWM.lib | Show annotated file Show diff for this revision Revisions of this file |
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 34b0063fab4c -r afa2c73359fa HSI2RGBW_PWM.lib --- a/HSI2RGBW_PWM.lib Mon Dec 30 11:26:47 2013 +0000 +++ b/HSI2RGBW_PWM.lib Sun Feb 02 14:54:55 2014 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/frankvnk/code/HSI2RGBW_PWM/#dda6914d713f +http://mbed.org/users/frankvnk/code/HSI2RGBW_PWM/#a16b9c09561e
diff -r 34b0063fab4c -r afa2c73359fa main.cpp --- 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); } } +