Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <FastLED.h>
- #define TONE_USE_INT
- #define TONE_PITCH 440
- #include <TonePitch.h>
- #define NUM_LEDS 512
- #define pinin 4
- #define pinout 3
- //RELAY
- int in1 = 2;
- int in2 = 3;
- int piezoPin = 8;
- //uint8_t ;
- CRGBArray<NUM_LEDS> leds;
- void setup()
- { FastLED.addLeds<NEOPIXEL,6>(leds, NUM_LEDS);
- pinMode (6,OUTPUT);
- pinMode (pinin, INPUT);
- pinMode (pinout, OUTPUT);
- digitalWrite(pinout, LOW);
- //RELAY
- pinMode(in1, OUTPUT);
- digitalWrite(in1, HIGH);
- pinMode(in2, OUTPUT);
- digitalWrite(in2, HIGH);
- random16_add_entropy(analogRead(0)); // seed random number generator
- }
- void loop()
- {
- leds (0,255)=CHSV(0,0,100);//WHITE
- for(int i= 3;i<=255;i+=4)/////////////////////////////
- {
- leds (i,i+1)=CHSV(96,255,55);//GREEN
- FastLED.delay(100);
- leds (i,i+1)=CHSV(96,255,55);//GREEN
- FastLED.delay(10);
- leds (i,i+=4)=CHSV(0,0,100);//WHITE
- FastLED.delay(50);
- leds (i,i-4)=CHSV(96,0,100);//GREEN
- FastLED.show();
- FastLED.delay(0);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment