Advertisement
Guest User

Untitled

a guest
Feb 5th, 2018
485
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. /* Code for FastLED video tutorial
  2. * by Nils Gregersen 2017
  3. * youtube: hamburgtech
  4. * email: info@hamburgtech.de
  5. */
  6.  
  7. #include <FastLED.h>
  8.  
  9. #define LED_PIN 11
  10. //#define CLOCK_PIN 4
  11. #define NUM_LEDS 144
  12. #define LED_TYPE WS2812B
  13. #define COLOR_ORDER GRB
  14. #define BRIGHTNESS 64
  15. int i=NUM_LEDS/2;
  16. int b=NUM_LEDS/2;
  17. CRGB leds[NUM_LEDS];
  18. CRGB leds_temp[NUM_LEDS/2];
  19. bool gReverseDirection = false;
  20. void setup() {
  21. delay(1000);
  22. LEDS.addLeds<LED_TYPE, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS);
  23. // LEDS.addLeds<LED_TYPE, LED_PIN, CLOCK_PIN COLOR_ORDER>(leds, NUM_LEDS);
  24. FastLED.setBrightness(BRIGHTNESS);
  25. }
  26.  
  27. void loop()
  28. {
  29.  
  30. halfstrip();
  31. // half();
  32.  
  33. FastLED.clear();
  34. FastLED.show(); // display leds
  35. FastLED.delay(1000 );
  36.  
  37. }
  38. void halfstrip(){
  39. for( int c=) {
  40. leds[c] = CRGB(255,0,0);
  41. leds[b] = CRGB(255,0,0);
  42. FastLED.show();
  43.  
  44. }
  45. FastLED.clear();
  46. }
  47.  
  48. /*void halfstrip(){
  49. for( int i = NUM_LEDS/2; i--;) {
  50. leds[i] = CRGB(255,0,0);
  51. FastLED.show();
  52.  
  53. }
  54. FastLED.clear();
  55. }
  56. void half(){
  57. for (int i=NUM_LEDS/2; i++;) {
  58. leds[i] = CRGB(255,0,0);
  59. FastLED.show();
  60. }
  61. FastLED.clear();
  62. }*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement