-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpulsar.txt
48 lines (44 loc) · 1 KB
/
pulsar.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include "FastLED.h"
//Êîëè÷åñòâî ñâåòîäèîäîâ
#define NUM_LEDS 20
//---------
//Óïðàâëÿþùèé ïèí
#define DATA_PIN 6
//---------
//ÕÇ çà÷åì ýòî, îñòàëîñü îò ïðåäûäóùåãî ïðîåêòà
#define CLOCK_PIN 13
//---------
//Íà÷àëüíàÿ ÿðêîñòü
int down = 255;
//---------
CRGB leds[NUM_LEDS];
void setup() {
LEDS.addLeds<WS2812,DATA_PIN,RGB>(leds,NUM_LEDS);
LEDS.setBrightness(84);
}
void loop() {
//Ïåðâûé áëîê çà 20 öèêëîâ óìåíüøàåì ÿðêîñòü, ñ çàäåðæêîé 100 ìèëèñåêóíä
for(int iq = 0; iq < 20; iq++) {
for(int i = 0; i < NUM_LEDS; i++) {
leds[i] = CHSV( HUE_GREEN, 255, down);
FastLED.show();
delay(1);
}
down = down - 10;
delay(100);
}
//Ïàóçà ìåæäó áëîêàìè â ìèëèñåêóíäàõ
delay(1000);
//Âòîðîé áëîê çà 20 öèêëîâ ïîâûøàåì ÿðêîñòü, ñ çàäåðæêîé 100 ìèëèñåêóíä
for(int iq = 0; iq < 20; iq++) {
for(int i = 0; i < NUM_LEDS; i++) {
leds[i] = CHSV( HUE_GREEN, 255, down);
FastLED.show();
delay(1);
}
down = down + 10;
delay(100);
}
//Ïàóçà ìåæäó áëîêàìè â ìèëèñåêóíäàõ
delay(1000);
}