Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <FastLED.h>
- #define NUM_LEDS 169
- #define NUM_LEDS_PER_LINE 14
- #define DATA_PIN 8
- #define COLOR_ORDER GRB
- #define CHIPSET WS2812B
- #define BRIGHTNESS 200
- #define VOLTS 5
- #define MAX_AMPS 40
- CRGB leds[NUM_LEDS];
- int s=1;
- int led=8;
- int micsensorpin=2;
- int micstate;
- void setup() {
- pinMode(led ,OUTPUT);
- pinMode(micsensorpin,INPUT);
- digitalWrite(led,0);
- digitalWrite(micsensorpin,0);
- FastLED.addLeds<CHIPSET,DATA_PIN,COLOR_ORDER>(leds,NUM_LEDS);
- // FastLED.setMaxPowerInVoltsAndMilliamps(VOLTS,MAX_AMPS);
- FastLED.setBrightness(BRIGHTNESS);
- FastLED.clear();
- FastLED.show();
- }
- void loop() {
- if(s==1)
- {
- for(int j=0;j<NUM_LEDS;j+=NUM_LEDS_PER_LINE)
- {
- for(int i=0;i<NUM_LEDS_PER_LINE ;i++)
- {
- leds[i+j]= CRGB (220,20,60); //leds[i]= CRGB (0,100,150);
- }
- delay(1000);
- FastLED.show();
- }
- s=0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement