PlatformIO package of the Teensy core framework compatible with GCC 10 & C++20
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

23 行
475B

  1. #include <FastLED.h>
  2. #define NUM_LEDS 40
  3. CRGBArray<NUM_LEDS> leds;
  4. void setup() { FastLED.addLeds<NEOPIXEL,6>(leds, NUM_LEDS); }
  5. void loop(){
  6. static uint8_t hue;
  7. for(int i = 0; i < NUM_LEDS/2; i++) {
  8. // fade everything out
  9. leds.fadeToBlackBy(40);
  10. // let's set an led value
  11. leds[i] = CHSV(hue++,255,255);
  12. // now, let's first 20 leds to the top 20 leds,
  13. leds(NUM_LEDS/2,NUM_LEDS-1) = leds(NUM_LEDS/2 - 1 ,0);
  14. FastLED.delay(33);
  15. }
  16. }