
Sample code for TI_NEOPIXEL
Revision 0:4a27f777203a, committed 2018-07-21
- Comitter:
- tichise
- Date:
- Sat Jul 21 06:46:04 2018 +0000
- Commit message:
- new
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TI_NEOPIXEL.lib Sat Jul 21 06:46:04 2018 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/tichise/code/TI_NEOPIXEL/#d7a396a60bdc
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sat Jul 21 06:46:04 2018 +0000 @@ -0,0 +1,33 @@ +#include "mbed.h" +#include "TI_NEOPIXEL.h" + +TI_NEOPIXEL neopixel(p11); + +int main() +{ + bool isRed = false; + + while(1) { + if (isRed) { + // neopixel.switchLightOff(16); + // neopixel.changeColor(16, (rgb_color) {50, 10, 170}); + neopixel.circleRainbow(16); + + } else { + rgb_color topColor = (rgb_color) {255, 0, 0}; + rgb_color bottomColor = (rgb_color) {0, 32, 255}; + neopixel.changePointColor(16, topColor, bottomColor); + + /* + rgb_color circleColor = (rgb_color){50, 10, 170}; + neopixel.circle(16, circleColor); + */ + + // neopixel.switchLightOn(16); + // neopixel.changeColor(16, (rgb_color) {255, 255, 255}); + } + isRed = !isRed; + + wait(2); + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sat Jul 21 06:46:04 2018 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/a7c7b631e539 \ No newline at end of file