Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Code for FastLED video tutorial
- * by Nils Gregersen 2017
- * youtube: hamburgtech
- * email: info@hamburgtech.de
- */
- #include <FastLED.h>
- #define LED_PIN 11
- //#define CLOCK_PIN 4
- #define NUM_LEDS 144
- #define LED_TYPE WS2812B
- #define COLOR_ORDER GRB
- #define BRIGHTNESS 64
- int i=NUM_LEDS/2;
- int b=NUM_LEDS/2;
- CRGB leds[NUM_LEDS];
- CRGB leds_temp[NUM_LEDS/2];
- bool gReverseDirection = false;
- void setup() {
- delay(1000);
- LEDS.addLeds<LED_TYPE, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS);
- // LEDS.addLeds<LED_TYPE, LED_PIN, CLOCK_PIN COLOR_ORDER>(leds, NUM_LEDS);
- FastLED.setBrightness(BRIGHTNESS);
- }
- void loop()
- {
- halfstrip();
- // half();
- FastLED.clear();
- FastLED.show(); // display leds
- FastLED.delay(1000 );
- }
- void halfstrip(){
- for( int c=) {
- leds[c] = CRGB(255,0,0);
- leds[b] = CRGB(255,0,0);
- FastLED.show();
- }
- FastLED.clear();
- }
- /*void halfstrip(){
- for( int i = NUM_LEDS/2; i--;) {
- leds[i] = CRGB(255,0,0);
- FastLED.show();
- }
- FastLED.clear();
- }
- void half(){
- for (int i=NUM_LEDS/2; i++;) {
- leds[i] = CRGB(255,0,0);
- FastLED.show();
- }
- FastLED.clear();
- }*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement