Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.98 KB | None | 0 0
  1. #include "FastLED.h"
  2.  
  3.  
  4. ////////////////////////////////////////////////////////////////////////////////////////////////////
  5. //
  6. // RGB Calibration code
  7. //
  8. // Use this sketch to determine what the RGB ordering for your chipset should be. Steps for setting up to use:
  9.  
  10. // * Uncomment the line in setup that corresponds to the LED chipset that you are using. (Note that they
  11. // all explicitly specify the RGB order as RGB)
  12. // * Define DATA_PIN to the pin that data is connected to.
  13. // * (Optional) if using software SPI for chipsets that are SPI based, define CLOCK_PIN to the clock pin
  14. // * Compile/upload/run the sketch
  15.  
  16. // You should see six leds on. If the RGB ordering is correct, you should see 1 red led, 2 green
  17. // leds, and 3 blue leds. If you see different colors, the count of each color tells you what the
  18. // position for that color in the rgb orering should be. So, for example, if you see 1 Blue, and 2
  19. // Red, and 3 Green leds then the rgb ordering should be BRG (Blue, Red, Green).
  20.  
  21. // You can then test this ordering by setting the RGB ordering in the addLeds line below to the new ordering
  22. // and it should come out correctly, 1 red, 2 green, and 3 blue.
  23. //
  24. //////////////////////////////////////////////////
  25.  
  26. #define NUM_LEDS 13
  27. #define NUM_LEDS2 33
  28. #define DATA_PIN 3
  29. #define DATA_PIN2 4
  30.  
  31. CRGB leds[NUM_LEDS];
  32.  
  33. CRGB leds2[NUM_LEDS2];
  34.  
  35. void setup() {
  36. // sanity check delay - allows reprogramming if accidently blowing power w/leds
  37. delay(2000);
  38.  
  39. FastLED.addLeds<WS2811, DATA_PIN, GBR>(leds, NUM_LEDS);
  40. }
  41.  
  42. void loop() {
  43. leds2[0] = CRGB(0, 0, 255);
  44. leds2[1] = CRGB(0, 0, 255);
  45. leds2[2] = CRGB(0, 0, 255);
  46. leds2[3] = CRGB(0, 0, 255);
  47. leds2[4] = CRGB(0, 0, 255);
  48. leds2[5] = CRGB(0, 0, 255);
  49. leds2[6] = CRGB(0, 0, 255);
  50. leds2[7] = CRGB(0, 0, 255);
  51. leds2[8] = CRGB(0, 0, 255);
  52. leds2[9] = CRGB(0, 0, 255);
  53. leds2[10] = CRGB(0, 0, 255);
  54. leds2[11] = CRGB(0, 0, 255);
  55. leds2[12] = CRGB(0, 0, 255);
  56. FastLED.show();
  57. delay(1000);
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement