Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // I tried the first one first, and then the second one!
- // They are somewhat edited, because I changed the DATA_PIN numbers a lot (started at 2),
- // and I also changed the colors a lot as well, number of LEDs targeted etc.
- // first one!!!
- #include <FastLED.h>
- #define NUM_LEDS 60
- #define DATA_PIN 5
- #define COLOR_ORDER GRB
- #define CHIPSET WS2812B
- #define BRIGHTNESS 60
- #define VOLTS 5
- #define MAX_AMPS 500
- CRGB leds[NUM_LEDS];
- void setup() {
- FastLED.addLeds<CHIPSET,DATA_PIN,COLOR_ORDER>(leds,NUM_LEDS);
- FastLED.setMaxPowerInVoltsAndMilliamps(VOLTS,MAX_AMPS);
- FastLED.setBrightness(BRIGHTNESS);
- FastLED.clear();
- FastLED.show();
- }
- void loop() {
- leds[0] = CRGB(255,0,0);
- leds[1] = CRGB(255,0,0);
- FastLED.show();
- delay(100);
- }
- // second one!!!
- #include <FastLED.h>
- #define NUM_LEDS 7
- #define DATA_PIN 2
- // #define COLOR_ORDER GRB
- #define CHIPSET WS2812B
- #define BRIGHTNESS 60
- #define VOLTS 5
- #define MAX_AMPS 500
- CRGB leds[NUM_LEDS];
- void setup() {
- // put your setup code here, to run once:
- delay(2000);
- FastLED.addLeds<WS2812B, DATA_PIN, RGB>(leds, NUM_LEDS);
- }
- void loop() {
- leds[0] = CRGB(255,0,0);
- leds[1] = CRGB(0,255,0);
- leds[2] = CRGB(0,255,0);
- leds[3] = CRGB(0,0,255);
- leds[4] = CRGB(0,0,255);
- leds[5] = CRGB(0,0,255);
- leds[6] = CRGB(0,0,0);
- FastLED.show();
- delay(1000);
- }
Advertisement
Add Comment
Please, Sign In to add comment