PlatformIO package of the Teensy core framework compatible with GCC 10 & C++20
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

ParallelOutputDemo.ino 1.7KB

pirms 3 gadiem
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #include <FastLED.h>
  2. #define NUM_LEDS_PER_STRIP 16
  3. // Note: this can be 12 if you're using a teensy 3 and don't mind soldering the pads on the back
  4. #define NUM_STRIPS 16
  5. CRGB leds[NUM_STRIPS * NUM_LEDS_PER_STRIP];
  6. // Pin layouts on the teensy 3/3.1:
  7. // WS2811_PORTD: 2,14,7,8,6,20,21,5
  8. // WS2811_PORTC: 15,22,23,9,10,13,11,12,28,27,29,30 (these last 4 are pads on the bottom of the teensy)
  9. // WS2811_PORTDC: 2,14,7,8,6,20,21,5,15,22,23,9,10,13,11,12 - 16 way parallel
  10. //
  11. // Pin layouts on the due
  12. // WS2811_PORTA: 69,68,61,60,59,100,58,31 (note: pin 100 only available on the digix)
  13. // WS2811_PORTB: 90,91,92,93,94,95,96,97 (note: only available on the digix)
  14. // WS2811_PORTD: 25,26,27,28,14,15,29,11
  15. //
  16. // IBCC<WS2811, 1, 16> outputs;
  17. void setup() {
  18. delay(5000);
  19. Serial.begin(57600);
  20. Serial.println("Starting...");
  21. // LEDS.addLeds<WS2811_PORTA,NUM_STRIPS>(leds, NUM_LEDS_PER_STRIP);
  22. // LEDS.addLeds<WS2811_PORTB,NUM_STRIPS>(leds, NUM_LEDS_PER_STRIP);
  23. // LEDS.addLeds<WS2811_PORTD,NUM_STRIPS>(leds, NUM_LEDS_PER_STRIP).setCorrection(TypicalLEDStrip);
  24. LEDS.addLeds<WS2811_PORTDC,NUM_STRIPS>(leds, NUM_LEDS_PER_STRIP);
  25. // Teensy 4 parallel output example
  26. // LEDS.addLeds<NUM_STRIPS, WS2811, 1>(leds,NUM_LEDS_PER_STRIP);
  27. }
  28. void loop() {
  29. Serial.println("Loop....");
  30. static uint8_t hue = 0;
  31. for(int i = 0; i < NUM_STRIPS; i++) {
  32. for(int j = 0; j < NUM_LEDS_PER_STRIP; j++) {
  33. leds[(i*NUM_LEDS_PER_STRIP) + j] = CHSV((32*i) + hue+j,192,255);
  34. }
  35. }
  36. // Set the first n leds on each strip to show which strip it is
  37. for(int i = 0; i < NUM_STRIPS; i++) {
  38. for(int j = 0; j <= i; j++) {
  39. leds[(i*NUM_LEDS_PER_STRIP) + j] = CRGB::Red;
  40. }
  41. }
  42. hue++;
  43. LEDS.show();
  44. // LEDS.delay(100);
  45. }