Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // *************************************
- // *************************************
- // **** TRYING TO FIGURE OUT ****
- // **** THE EVERY_N_MILLISECONDS ****
- // **** FUNCTION ****
- // *************************************
- // *************************************
- //
- //
- // *************************************
- // *** ***
- // *** UNTESTED ***
- // *** ***
- // *************************************
- //
- //
- //
- #include "FastLED.h"
- //
- #define DATA_PIN 8
- //
- //#define CLK_PIN 4
- //
- #define NUM_LEDS 100
- //
- CRGB leds[NUM_LEDS];
- // the above creates an LED array to hold
- // the values for each led in your strip
- // Whatever THAT means :)
- //
- // ****************
- // ****************
- // ** VOID SETUP **
- // ****************
- // ****************
- //
- void setup()
- // void setup gets everything ready for what will run in the void loop.
- {
- //
- delay(3000); // 3 second delay for recovery
- //
- FastLED.setBrightness(96);
- //
- FastLED.addLeds<WS2812B, DATA_PIN, GRB>(leds, NUM_LEDS);
- //
- // FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);
- // The above is another common type of strip
- // You would comment the WS2812B and uncomment the Neopixel to use it.
- //
- }
- //
- // ***************
- // ***************
- // ** VOID LOOP **
- // ***************
- // ***************
- //
- void loop()
- //
- {
- //
- //
- EVERY_N_MILLISECONDS(5000) {
- leds[0] = CHSV( 0, 255, 255);
- FastLED.show();
- delay(1000);
- leds[0] = CHSV( 0, 255, 0);
- FastLED.show();
- }
- //
- //
- EVERY_N_MILLISECONDS(2500) {
- leds[2] = CHSV( 96, 255, 255);
- FastLED.show();
- delay(1000);
- leds[2] = CHSV( 96, 255, 0);
- FastLED.show();
- }
- //
- //
- EVERY_N_MILLISECONDS(2500) {
- leds[4] = CHSV( 160, 255, 255);
- leds[4].fadeToBlackBy(50);
- FastLED.show();
- }
- //
- //************************************
- EVERY_N_MILLISECONDS(5000) {// *
- leds[6] = CHSV( 0, 255, 255);// *
- FastLED.show();// *
- }// *
- EVERY_N_MILLISECONDS(5000+500) {// *
- leds[6] = CHSV( 0, 255, 0);// *
- FastLED.show();// *
- }//***********************************
- //
- //
- }
Advertisement
Add Comment
Please, Sign In to add comment