allanGEE

FastLED trying to figure out .maximizeBrightness

Nov 25th, 2016
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.57 KB | None | 0 0
  1. // *************************************
  2. // *************************************
  3. // **** UNTESTED ****
  4. // *************************************
  5. // *************************************
  6. //
  7. #include "FastLED.h"
  8. //
  9. #define DATA_PIN 8
  10. //
  11. //#define CLK_PIN 4
  12. //
  13. #define NUM_LEDS 5
  14. //
  15. CRGB leds[NUM_LEDS];
  16. // the above creates an LED array to hold
  17. // the values for each led in your strip
  18. // Whatever THAT means :)
  19. //
  20. // ****************
  21. // ****************
  22. // ** VOID SETUP **
  23. // ****************
  24. // ****************
  25. //
  26. void setup()
  27. // void setup gets everything ready for what will run in the void loop.
  28. {
  29. //
  30. delay(3000); // 3 second delay for recovery
  31. //
  32. //FastLED.setBrightness(96);
  33. // Commented the above because I'm only working with a couple
  34. // of LEDs at a time -- no chance of burning out my
  35. // Arduino.
  36. //
  37. FastLED.addLeds<WS2812B, DATA_PIN, GRB>(leds, NUM_LEDS);
  38. //
  39. // FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);
  40. // The above is another common type of strip
  41. // You would comment the WS2812B and uncomment the Neopixel to use it.
  42. //
  43. }
  44. //
  45. // ***************
  46. // ***************
  47. // ** VOID LOOP **
  48. // ***************
  49. // ***************
  50. //
  51. void loop()
  52. //
  53. {
  54. //
  55. for(int i = 0; i < NUM_LEDS; i++) {
  56. // The above starts at the first LED, 0, and then counts up one every time it loops
  57. // as long as it's less than the total number of LEDs set in the initial parameters.
  58. leds[i] = CHSV( 0, 255, 0);
  59. // The above sets the current LED to red but at "zero" brightness, or off, using Hue Saturation Value
  60. //
  61. leds[0].maximizeBrightness(25);
  62. // HOPING the above fades up the first LED
  63. // in increments of 25
  64. //
  65. // ???????????????????????????
  66. // ???????????????????????????
  67. // ???????????????????????????
  68. // Should the show function be before or after the } BELOW
  69. //
  70. FastLED.show(); // tells FastLED to display what you've asked for above
  71. //
  72. // ???????????????????????????
  73. // ???????????????????????????
  74. // ???????????????????????????
  75. // Should the delay function be before or after the } BELOW
  76. delay(5000);
  77. //
  78. //
  79. }// *********** THIS } ************
  80. //
  81. //
  82. // ???????????????????????????
  83. // ???????????????????????????
  84. // ???????????????????????????
  85. // Should the show function be before or after the } ABOVE
  86. // FastLED.show(); // tells FastLED to display what you've asked for above
  87. //
  88. // ???????????????????????????
  89. // ???????????????????????????
  90. // ???????????????????????????
  91. // Should the delay function be before or after the } ABOVE
  92. // delay(5000);
  93. }
  94. //
Advertisement
Add Comment
Please, Sign In to add comment