PlatformIO package of the Teensy core framework compatible with GCC 10 & C++20
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

пре 3 година
12345678910111213141516171819202122
  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. }