Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "FastLED.h"
- #define DATA_PIN 5
- #define Color_ORDER GRB
- #define LED_TYPE WS2812B
- #define NUM_LEDS 5
- CRGB leds[NUM_LEDS];
- #define NUM_RAILA 3
- #define NUM_CAPS 2
- uint8_t raila[NUM_RAILA] = {0,1,3 };
- uint8_t caps[NUM_CAPS] = {2,4 };
- void setup() {
- FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);
- }
- void loop ()
- {
- for (int i = 0; i < NUM_RAILA; i++)
- leds[raila[i]] = CRGB::White;
- }
- {
- for (int i = 0; i < NUM_CAPS; i++)
- leds[caps[i]] = CRGB::Blue;
- }
- //for (int i = 0; i < NUM_RAILA; i++) {
- //leds[raila[i]] = CRGB::White;
- //}
- //for (int i = 0; i < NUM_CAPS; i++) {
- //leds[raila[i]] = CRGB::Blue;
- //}
- //FastLED.show();
- {
- FastLED.show();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement