takuya ichise
/
TI_NEOPIXEL_SAMPLE
Sample code for TI_NEOPIXEL
Embed:
(wiki syntax)
Show/hide line numbers
main.cpp
00001 #include "mbed.h" 00002 #include "TI_NEOPIXEL.h" 00003 00004 TI_NEOPIXEL neopixel(p11); 00005 00006 int main() 00007 { 00008 bool isRed = false; 00009 00010 while(1) { 00011 if (isRed) { 00012 // neopixel.switchLightOff(16); 00013 // neopixel.changeColor(16, (rgb_color) {50, 10, 170}); 00014 neopixel.circleRainbow(16); 00015 00016 } else { 00017 rgb_color topColor = (rgb_color) {255, 0, 0}; 00018 rgb_color bottomColor = (rgb_color) {0, 32, 255}; 00019 neopixel.changePointColor(16, topColor, bottomColor); 00020 00021 /* 00022 rgb_color circleColor = (rgb_color){50, 10, 170}; 00023 neopixel.circle(16, circleColor); 00024 */ 00025 00026 // neopixel.switchLightOn(16); 00027 // neopixel.changeColor(16, (rgb_color) {255, 255, 255}); 00028 } 00029 isRed = !isRed; 00030 00031 wait(2); 00032 } 00033 }
Generated on Fri Jul 22 2022 09:44:47 by 1.7.2