Skip to content

Commit 7ce9291

Browse files
committed
1 light brightness
Added support for single-tally brightness
1 parent 1908cae commit 7ce9291

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Diff for: toArduino/OBS-tallyWithPrev/OBS-tallyWithPrev.ino

+5-4
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ int currentLive1; int currentLive2; int currentLive3; int currentLive4;
4848
int lastLive1; int lastLive2; int lastLive3; int lastLive4;
4949

5050
// Serial Variables
51-
char readString[15];
51+
char readString[64];
5252
int startbit;
5353
int Idx1;
5454
int Idx2;
@@ -167,7 +167,7 @@ void loop(void) {
167167
if(Serial.available()) { // Check if recieving data
168168

169169
readSerial(); // Record serial bits from incoming serial stream.
170-
170+
171171
////////////// Preview Range //////////////
172172
if (startbit == 50) { currentPreview1 = Idx1; currentPreview2 = Idx2; currentPreview3 = Idx3; currentPreview4 = Idx4; }
173173

@@ -200,8 +200,9 @@ void loop(void) {
200200
if(currentLive4 >= 0){ fill_solid( ledarray[currentLive4], NUM_LEDS, CRGB::Red ); numLive = numLive + 1; }
201201

202202
// 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
205206
numLive = 0; numPreview = 0; // Reset live/preview counters
206207

207208
}else { //If not recieving any data

0 commit comments

Comments
 (0)