allanGEE

Theater Chase 2016-11-18

Nov 18th, 2016
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. #include "FastLED.h"
  2. //
  3. #define DATA_PIN 8
  4. //
  5. //#define CLK_PIN 4
  6. //
  7. #define NUM_LEDS 100
  8. //
  9. CRGB leds[NUM_LEDS];
  10. // the above creates an LED array to hold
  11. // the values for each led in your strip
  12. // Whatever THAT means :)
  13. //
  14. // ****************
  15. // ****************
  16. // ** VOID SETUP **
  17. // ****************
  18. // ****************
  19. //
  20. void setup()
  21. // void setup gets everything ready for what will run in the void loop.
  22. {
  23. //
  24. delay(3000); // 3 second delay for recovery
  25. //
  26. FastLED.setBrightness(96);
  27. //
  28. FastLED.addLeds<WS2812B, DATA_PIN, GRB>(leds, NUM_LEDS);
  29. //
  30. // FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);
  31. // The above is another common type of strip
  32. // You would comment the WS2812B and uncomment the Neopixel to use it.
  33. //
  34. }
  35. //
  36. // ***************
  37. // ***************
  38. // ** VOID LOOP **
  39. // ***************
  40. // ***************
  41. //
  42. void loop()
  43. //
  44. {
  45. //
  46. for (int j=0; j<10; j++) //do 10 cycles of chasing ????? what does this do
  47. {
  48. for (int q=0; q < 3; q++)
  49. {
  50. for (int i=0; i < NUM_LEDS; i=i+3)
  51. {
  52. leds[i+q] = CHSV(0,255,255); //turn every third pixel on
  53. }
  54. FastLED.show();
  55. //
  56. delay(300);
  57. //
  58. for (int i=0; i < NUM_LEDS; i=i+3)
  59. {
  60. leds[i+q] = CHSV(0,255,0); //turn every third pixel off
  61. // setPixel(i+q, 0,0,0);
  62. }
  63. }
  64. }
  65. }
Advertisement
Add Comment
Please, Sign In to add comment