gioreva

Untitled

Mar 20th, 2018
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.88 KB | None | 0 0
  1. #define NUM_STRIPS 8
  2. #define NUM_LEDS_PER_STRIP 10
  3.  
  4. #define IngressoA 5
  5. #define IngressoB 18
  6. #define IngressoC 19
  7.  
  8. #define cRed CRGB( 255, 0, 0)
  9. #define cGreen CRGB( 0, 255, 0)
  10. #define cBlue CRGB( 0, 0, 255)
  11.  
  12. #define CorrezzioneBianco CRGB( 255, 255, 255)
  13. #define Luminosita 50 // Luminosita Massima (255)
  14.  
  15.  
  16. eSegmenti.h"
  17. #include "FastLED.h"
  18.  
  19. FASTLED_USING_NAMESPACE
  20.  
  21. #define NUM_LEDS NUM_LEDS_PER_STRIP * NUM_STRIPS
  22. #define LED_TYPE WS2812
  23.  
  24. CRGB leds[NUM_STRIPS * NUM_LEDS_PER_STRIP];
  25.  
  26. void setup() {
  27. FastLED.addLeds<LED_TYPE, 13>(leds, 0, NUM_LEDS_PER_STRIP);
  28. #if NUM_STRIPS > 1
  29. FastLED.addLeds<LED_TYPE, 12>(leds, NUM_LEDS_PER_STRIP, NUM_LEDS_PER_STRIP);
  30. #endif
  31. #if NUM_STRIPS > 2
  32. FastLED.addLeds<LED_TYPE, 14>(leds, 2 * NUM_LEDS_PER_STRIP, NUM_LEDS_PER_STRIP);
  33. #endif
  34. #if NUM_STRIPS > 3
  35. FastLED.addLeds<LED_TYPE, 27>(leds, 3 * NUM_LEDS_PER_STRIP, NUM_LEDS_PER_STRIP);
  36. #endif
  37. #if NUM_STRIPS > 4
  38. FastLED.addLeds<LED_TYPE, 26>(leds, 4 * NUM_LEDS_PER_STRIP, NUM_LEDS_PER_STRIP);
  39. #endif
  40. #if NUM_STRIPS > 5
  41. FastLED.addLeds<LED_TYPE, 25>(leds, 5 * NUM_LEDS_PER_STRIP, NUM_LEDS_PER_STRIP);
  42. #endif
  43. #if NUM_STRIPS > 6
  44. FastLED.addLeds<LED_TYPE, 33>(leds, 6 * NUM_LEDS_PER_STRIP, NUM_LEDS_PER_STRIP);
  45. #endif
  46. #if NUM_STRIPS > 7
  47. FastLED.addLeds<LED_TYPE, 32>(leds, 7 * NUM_LEDS_PER_STRIP, NUM_LEDS_PER_STRIP);
  48. #endif
  49. #ifdef Luminosita
  50. FastLED.setBrightness( Luminosita );
  51. #endif
  52. #ifdef CorrezzioneBianco
  53. FastLED.setTemperature( CorrezzioneBianco );
  54. #endif
  55.  
  56. for(int i = 0; i < NUM_LEDS; i++) leds[i] = CRGB::Red;
  57.  
  58. }
  59.  
  60. void loop() {
  61. // for(int i = 0; i < NUM_LEDS; i++) leds[i] = cRed;
  62. // for(int i = 0; i < NUM_LEDS; i++) leds[i] = cGreen;
  63. for(int i = 0; i < NUM_LEDS; i++) leds[i] = cBlue;
  64. FastLED.show();
  65. delay(100);
  66. for(int i = 0; i < NUM_LEDS; i++) leds[i] = CRGB::Black;
  67. FastLED.show();
  68. delay(100);
  69. }
Add Comment
Please, Sign In to add comment