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.

RGBCalibrate.ino 4.8KB

3 jaren geleden
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. #include "FastLED.h"
  2. ////////////////////////////////////////////////////////////////////////////////////////////////////
  3. //
  4. // RGB Calibration code
  5. //
  6. // Use this sketch to determine what the RGB ordering for your chipset should be. Steps for setting up to use:
  7. // * Uncomment the line in setup that corresponds to the LED chipset that you are using. (Note that they
  8. // all explicitly specify the RGB order as RGB)
  9. // * Define DATA_PIN to the pin that data is connected to.
  10. // * (Optional) if using software SPI for chipsets that are SPI based, define CLOCK_PIN to the clock pin
  11. // * Compile/upload/run the sketch
  12. // You should see six leds on. If the RGB ordering is correct, you should see 1 red led, 2 green
  13. // leds, and 3 blue leds. If you see different colors, the count of each color tells you what the
  14. // position for that color in the rgb orering should be. So, for example, if you see 1 Blue, and 2
  15. // Red, and 3 Green leds then the rgb ordering should be BRG (Blue, Red, Green).
  16. // You can then test this ordering by setting the RGB ordering in the addLeds line below to the new ordering
  17. // and it should come out correctly, 1 red, 2 green, and 3 blue.
  18. //
  19. //////////////////////////////////////////////////
  20. #define NUM_LEDS 7
  21. // For led chips like WS2812, which have a data line, ground, and power, you just
  22. // need to define DATA_PIN. For led chipsets that are SPI based (four wires - data, clock,
  23. // ground, and power), like the LPD8806 define both DATA_PIN and CLOCK_PIN
  24. // Clock pin only needed for SPI based chipsets when not using hardware SPI
  25. #define DATA_PIN 3
  26. #define CLOCK_PIN 13
  27. CRGB leds[NUM_LEDS];
  28. void setup() {
  29. // sanity check delay - allows reprogramming if accidently blowing power w/leds
  30. delay(2000);
  31. // Uncomment/edit one of the following lines for your leds arrangement.
  32. // ## Clockless types ##
  33. // FastLED.addLeds<SM16703, DATA_PIN, RGB>(leds, NUM_LEDS);
  34. // FastLED.addLeds<TM1829, DATA_PIN, RGB>(leds, NUM_LEDS);
  35. // FastLED.addLeds<TM1812, DATA_PIN, RGB>(leds, NUM_LEDS);
  36. // FastLED.addLeds<TM1809, DATA_PIN, RGB>(leds, NUM_LEDS);
  37. // FastLED.addLeds<TM1804, DATA_PIN, RGB>(leds, NUM_LEDS);
  38. // FastLED.addLeds<TM1803, DATA_PIN, RGB>(leds, NUM_LEDS);
  39. // FastLED.addLeds<UCS1903, DATA_PIN, RGB>(leds, NUM_LEDS);
  40. // FastLED.addLeds<UCS1903B, DATA_PIN, RGB>(leds, NUM_LEDS);
  41. // FastLED.addLeds<UCS1904, DATA_PIN, RGB>(leds, NUM_LEDS);
  42. // FastLED.addLeds<UCS2903, DATA_PIN, RGB>(leds, NUM_LEDS);
  43. // FastLED.addLeds<WS2812, DATA_PIN, RGB>(leds, NUM_LEDS); // GRB ordering is typical
  44. // FastLED.addLeds<WS2852, DATA_PIN, RGB>(leds, NUM_LEDS); // GRB ordering is typical
  45. // FastLED.addLeds<WS2812B, DATA_PIN, RGB>(leds, NUM_LEDS); // GRB ordering is typical
  46. // FastLED.addLeds<GS1903, DATA_PIN, RGB>(leds, NUM_LEDS);
  47. // FastLED.addLeds<SK6812, DATA_PIN, RGB>(leds, NUM_LEDS); // GRB ordering is typical
  48. // FastLED.addLeds<SK6822, DATA_PIN, RGB>(leds, NUM_LEDS);
  49. // FastLED.addLeds<APA106, DATA_PIN, RGB>(leds, NUM_LEDS);
  50. // FastLED.addLeds<PL9823, DATA_PIN, RGB>(leds, NUM_LEDS);
  51. // FastLED.addLeds<SK6822, DATA_PIN, RGB>(leds, NUM_LEDS);
  52. // FastLED.addLeds<WS2811, DATA_PIN, RGB>(leds, NUM_LEDS);
  53. // FastLED.addLeds<WS2813, DATA_PIN, RGB>(leds, NUM_LEDS);
  54. // FastLED.addLeds<APA104, DATA_PIN, RGB>(leds, NUM_LEDS);
  55. // FastLED.addLeds<WS2811_400, DATA_PIN, RGB>(leds, NUM_LEDS);
  56. // FastLED.addLeds<GE8822, DATA_PIN, RGB>(leds, NUM_LEDS);
  57. // FastLED.addLeds<GW6205, DATA_PIN, RGB>(leds, NUM_LEDS);
  58. // FastLED.addLeds<GW6205_400, DATA_PIN, RGB>(leds, NUM_LEDS);
  59. // FastLED.addLeds<LPD1886, DATA_PIN, RGB>(leds, NUM_LEDS);
  60. // FastLED.addLeds<LPD1886_8BIT, DATA_PIN, RGB>(leds, NUM_LEDS);
  61. // ## Clocked (SPI) types ##
  62. // FastLED.addLeds<LPD6803, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS); // GRB ordering is typical
  63. // FastLED.addLeds<LPD8806, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS); // GRB ordering is typical
  64. // FastLED.addLeds<WS2801, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
  65. // FastLED.addLeds<WS2803, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
  66. // FastLED.addLeds<SM16716, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
  67. // FastLED.addLeds<P9813, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS); // BGR ordering is typical
  68. // FastLED.addLeds<DOTSTAR, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS); // BGR ordering is typical
  69. // FastLED.addLeds<APA102, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS); // BGR ordering is typical
  70. // FastLED.addLeds<SK9822, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS); // BGR ordering is typical
  71. // FastLED.setBrightness(CRGB(255,255,255));
  72. }
  73. void loop() {
  74. leds[0] = CRGB(255,0,0);
  75. leds[1] = CRGB(0,255,0);
  76. leds[2] = CRGB(0,255,0);
  77. leds[3] = CRGB(0,0,255);
  78. leds[4] = CRGB(0,0,255);
  79. leds[5] = CRGB(0,0,255);
  80. leds[6] = CRGB(0,0,0);
  81. FastLED.show();
  82. delay(1000);
  83. }