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.

OctoWS2811Demo.ino 791B

3 years ago
12345678910111213141516171819202122232425262728293031323334353637
  1. #define USE_OCTOWS2811
  2. #include <OctoWS2811.h>
  3. #include <FastLED.h>
  4. #define NUM_LEDS_PER_STRIP 64
  5. #define NUM_STRIPS 8
  6. CRGB leds[NUM_STRIPS * NUM_LEDS_PER_STRIP];
  7. // Pin layouts on the teensy 3:
  8. // OctoWS2811: 2,14,7,8,6,20,21,5
  9. void setup() {
  10. LEDS.addLeds<OCTOWS2811>(leds, NUM_LEDS_PER_STRIP);
  11. LEDS.setBrightness(32);
  12. }
  13. void loop() {
  14. static uint8_t hue = 0;
  15. for(int i = 0; i < NUM_STRIPS; i++) {
  16. for(int j = 0; j < NUM_LEDS_PER_STRIP; j++) {
  17. leds[(i*NUM_LEDS_PER_STRIP) + j] = CHSV((32*i) + hue+j,192,255);
  18. }
  19. }
  20. // Set the first n leds on each strip to show which strip it is
  21. for(int i = 0; i < NUM_STRIPS; i++) {
  22. for(int j = 0; j <= i; j++) {
  23. leds[(i*NUM_LEDS_PER_STRIP) + j] = CRGB::Red;
  24. }
  25. }
  26. hue++;
  27. LEDS.show();
  28. LEDS.delay(10);
  29. }