File tree 1 file changed +5
-4
lines changed
toArduino/OBS-tallyWithPrev
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ int currentLive1; int currentLive2; int currentLive3; int currentLive4;
48
48
int lastLive1; int lastLive2; int lastLive3; int lastLive4;
49
49
50
50
// Serial Variables
51
- char readString[15 ];
51
+ char readString[64 ];
52
52
int startbit;
53
53
int Idx1;
54
54
int Idx2;
@@ -167,7 +167,7 @@ void loop(void) {
167
167
if (Serial.available ()) { // Check if recieving data
168
168
169
169
readSerial (); // Record serial bits from incoming serial stream.
170
-
170
+
171
171
// //////////// Preview Range //////////////
172
172
if (startbit == 50 ) { currentPreview1 = Idx1; currentPreview2 = Idx2; currentPreview3 = Idx3; currentPreview4 = Idx4; }
173
173
@@ -200,8 +200,9 @@ void loop(void) {
200
200
if (currentLive4 >= 0 ){ fill_solid ( ledarray[currentLive4], NUM_LEDS, CRGB::Red ); numLive = numLive + 1 ; }
201
201
202
202
// Set duty cycle based on count of live and preview tallies
203
- if ( numPreview > 0 && numPreview < 2 || numLive > 0 && numLive < 2 ) { FastLED.setBrightness (DUTY_CYCLE*.10 ); }// Only 2 lights, use 10% duty cycle
204
- if ( numPreview >= 2 || numLive >= 2 ) { FastLED.setBrightness (DUTY_CYCLE*.05 ); }// 2 or more lights, use 5% duty cycle
203
+ if ( numPreview > 0 && numPreview <= 1 || numLive > 0 && numLive <= 1 ) { FastLED.setBrightness (DUTY_CYCLE*.50 ); }// Only 1 light, use 50% duty cycle
204
+ if ( numPreview > 1 && numPreview <= 2 || numLive > 1 && numLive <= 2 ) { FastLED.setBrightness (DUTY_CYCLE*.10 ); }// Only 2 lights, use 10% duty cycle
205
+ if ( numPreview > 2 || numLive > 2 ) { FastLED.setBrightness (DUTY_CYCLE*.05 ); }// 2 or more lights, use 5% duty cycle
205
206
numLive = 0 ; numPreview = 0 ; // Reset live/preview counters
206
207
207
208
}else { // If not recieving any data
You can’t perform that action at this time.
0 commit comments