allanGEE

FastLED Candy Cane Static TEST 2016_11_30

Nov 30th, 2016
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.06 KB | None | 0 0
  1. // ****************************
  2. // ****************************
  3. // **** UNTESTED ***
  4. // ****************************
  5. // ****************************
  6. //
  7. //
  8. // ****************************
  9. // ****************************
  10. // **** CANDY CANE COLORS ***
  11. // *** NO ANIMATION ***
  12. // ****************************
  13. // ****************************
  14. //
  15. #include "FastLED.h"
  16. //
  17. #define DATA_PIN 8
  18. //
  19. //#define CLK_PIN 4
  20. //
  21. #define NUM_LEDS 100
  22. //
  23. CRGB leds[NUM_LEDS];
  24. // the above creates an LED array to hold
  25. // the values for each led in your strip
  26. // Whatever THAT means :)
  27. //
  28. // ****************
  29. // ****************
  30. // ** VOID SETUP **
  31. // ****************
  32. // ****************
  33. //
  34. void setup()
  35. // void setup gets everything ready for what will run in the void loop.
  36. {
  37. //
  38. delay(3000); // 3 second delay for recovery
  39. //
  40. FastLED.setBrightness(96);
  41. //
  42. FastLED.addLeds<WS2812B, DATA_PIN, GRB>(leds, NUM_LEDS);
  43. //
  44. // FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);
  45. // The above is another common type of strip
  46. // You would comment the WS2812B and uncomment the Neopixel to use it.
  47. //
  48. }
  49. //
  50. // ***************
  51. // ***************
  52. // ** VOID LOOP **
  53. // ***************
  54. // ***************
  55. //
  56. void loop()
  57. //
  58. {
  59. //
  60. fill_solid(leds, NUM_LEDS, CHSV(0,255,255) ); // fill entire strip will Red
  61. //fill_solid(leds, NUM_LEDS, CHSV(random8(),255,255) ); // fill entire strip will random color
  62. // uint8_t myColor = random8(); //pick a random color
  63. for(int i = 0; i < NUM_LEDS; i+=5) //chooses every 5th LED starting at 0
  64. {
  65. // leds[i] = CHSV(myColor, 255, 255); works with line above to fill random colors
  66. leds[i] = CHSV(0, 0, 200); //fill every 5th LED with White, with the brightness turned down a little
  67. }
  68. for(int i = 1; i < NUM_LEDS; i+=5) //chooses every 5th LED BUT starting at 1
  69. {
  70. // leds[i] = CHSV(myColor, 255, 255); works with line above to fill random colors
  71. leds[i] = CHSV(96, 255, 255); //fill every 5th LED with Green
  72. }
  73. FastLED.show();
  74.  
  75. //
  76. }
  77. //
Advertisement
Add Comment
Please, Sign In to add comment