Skip to content

Commit d38e5bf

Browse files
authored
Update and rename RGB_LED_Strip_Arduino_IR_Controller.ino to RGB_LED_Strip_Arduino_Controller.ino
1 parent 338d401 commit d38e5bf

File tree

1 file changed

+34
-58
lines changed

1 file changed

+34
-58
lines changed

RGB_LED_Strip_Arduino_IR_Controller.ino renamed to RGB_LED_Strip_Arduino_Controller.ino

Lines changed: 34 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,14 @@
22

33
#define LED_PIN 7
44
#define NUM_LEDS 60
5+
#define bright = 100
56

67
CRGB leds[NUM_LEDS];
78

89
char incoming_command = '0';
9-
long ran = random(NUM_LEDS);
10-
long de = random(1000);
11-
1210
int l = 1;
1311
boolean setting = 0;
1412

15-
int bright = 50;
16-
1713
void check_for_input() {
1814
if (Serial.available() > 0) {
1915
// read the incoming byte:
@@ -34,29 +30,14 @@ void setup() {
3430

3531
void loop() {
3632
int L = 60-l;
37-
int M;
3833
check_for_input();
39-
if (incoming_command == 'G'){
34+
if (incoming_command == 'G'){ //Activation and deactivation button for the second control
4035
Serial.println("Switching: ");
4136
setting = !setting;
4237
Serial.println(setting);
4338
delay(1000);
4439
}
45-
// if (setting == 0){
46-
// M = 60;
47-
// }
48-
// else if (setting == 1){
49-
// M = L;
50-
// }
51-
else if (incoming_command == '1'){
52-
Serial.println("RED");
53-
for (int i = 0; i <= L; i++) {
54-
leds[i] = CRGB (255,0,0);
55-
FastLED.show();
56-
delay(40);
57-
}
58-
}
59-
else if (incoming_command == 'F'){
40+
else if (incoming_command == 'F'){ //Choosing second person's amount of LEDs
6041
for (int i = 60; i >= 0; i--) {
6142
leds[i] = CRGB (0,0,0);
6243
FastLED.show();
@@ -67,9 +48,6 @@ void loop() {
6748
pl:
6849
check_for_input();
6950
Serial.println(l);
70-
//while((incoming_command != 'A') || (incoming_command != 'B') || (incoming_command != 'D')){
71-
// check_for_input();
72-
//}
7351
if (incoming_command == 'B'){
7452
if (l < 60){
7553
l++;
@@ -80,10 +58,6 @@ void loop() {
8058
l--;
8159
}
8260
}
83-
//for (int i = l; i >= 0; i--) {
84-
// leds[i] = CRGB (0,0,0);
85-
// FastLED.show();
86-
//}
8761
leds[l] = CRGB (255,0,0);
8862
FastLED.show();
8963
if (incoming_command != 'A'){
@@ -97,12 +71,21 @@ void loop() {
9771
}
9872
else if (incoming_command == '0'){
9973
Serial.println("WHITE");
100-
for (int i = 0; i <= L; i++) {/////////////////////////////
74+
for (int i = 0; i <= L; i++) {
10175
leds[i] = CRGB (255,255,255);
10276
FastLED.show();
10377
delay(40);
10478
}
10579
}
80+
else if (incoming_command == '1'){
81+
Serial.println("RED");
82+
for (int i = 0; i <= L; i++) {
83+
leds[i] = CRGB (255,0,0);
84+
FastLED.show();
85+
delay(40);
86+
}
87+
}
88+
10689
else if (incoming_command == '2'){
10790
Serial.println("ORANGE");
10891
for (int i = 0; i <= L; i++) {
@@ -166,25 +149,6 @@ void loop() {
166149
delay(40);
167150
}
168151
}
169-
else if (incoming_command == 'E'){
170-
sp:
171-
rainbowCycle(10);
172-
if (incoming_command != 'A'){
173-
goto sp;
174-
}
175-
}
176-
else if (incoming_command == 'B'){
177-
if (bright < 100){
178-
bright++;
179-
}
180-
FastLED.setBrightness(bright);
181-
}
182-
else if (incoming_command == 'D'){
183-
if (bright > 0){
184-
bright--;
185-
}
186-
FastLED.setBrightness(bright);
187-
}
188152
else if (incoming_command == 'A' && setting == 0){
189153
for (int i = 60; i >= 0; i--) {
190154
leds[i] = CRGB (0,0,0);
@@ -199,6 +163,18 @@ void loop() {
199163
delay(40);
200164
}
201165
}
166+
else if (incoming_command == 'B'){
167+
if (bright < 100){
168+
bright++;
169+
}
170+
FastLED.setBrightness(bright);
171+
}
172+
else if (incoming_command == 'D'){
173+
if (bright > 0){
174+
bright--;
175+
}
176+
FastLED.setBrightness(bright);
177+
}
202178
else if (incoming_command == 'C'){
203179
for (int i = 0; i <= 60; i++) {
204180
leds[i] = CRGB (0,0,0);
@@ -220,6 +196,15 @@ void loop() {
220196
goto st;
221197
}
222198
}
199+
else if (incoming_command == 'E'){
200+
sp:
201+
rainbowCycle(10);
202+
if (incoming_command != 'A'){
203+
goto sp;
204+
}
205+
}
206+
207+
//#2 Control
223208
else if (incoming_command == 'Q' && setting == 1){
224209
Serial.println("WHITE2");
225210
for (int i = L; i <= 60; i++) {
@@ -301,11 +286,6 @@ void loop() {
301286
}
302287
}
303288

304-
305-
306-
307-
308-
309289
void rainbowCycle(int SpeedDelay) {
310290
byte *c;
311291
uint16_t i, j;
@@ -348,10 +328,6 @@ byte * Wheel(byte WheelPos) {
348328
return c;
349329
}
350330

351-
352-
353-
354-
355331
void showStrip() {
356332
#ifdef ADAFRUIT_NEOPIXEL_H
357333
// NeoPixel

0 commit comments

Comments
 (0)