LEDs blink then go to previous state

I don't know the best way to explain this, I also don't know if this is the proper section because it deals with both programming and general project. I've been working on this for a few days and have gotten incredibly stuck but persevered and got a barely working prototype.

I've been working on a camera tally system, seeing as they are $$$$ I decided to make my own. Basically it shows what camera is currently live and which camera is about to be live. I don't mean to give you too much information but the software we use is called tricaster and when a button is pressed it switches the current preview camera to live and the last live to preview. I have a few different variations of code ill upload the best working one and maybe the other few if we can't get this to work.

I was gonna put the code here but hit the max limit

I tried to go through and comment on most of my thought process, I had already gone through my last draft and made it much easier to understand I can post that if need be. I have tried just changing the color but that got wayyy too confusing and a large project way too quickly.

I will/would upload a fritzing diagram but my account got deactivated since I haven't been on in a while, I'll have that in a little bit. My problem with this current design is that occasionally the leds will go to the proper spot then switches right back, here is a bad video XD. Ideas? Any help is appreciated.

char preview;   // for incoming serial data
/* PREVIEW */
char cam1;  //variable for camera 1 preview led
char cam2;  //variable for camera 2 preview led
char cam3;  //variable for camera 3 preview led
char cam4;  //variable for camera 4 preview led
/* PROGRAM */
char prgm1; //variable for camera 1 program led
char prgm2; //variable for camera 2 program led
char prgm3; //variable for camera 3 program led
char prgm4; //variable for camera 4 program led



void setup() {
        Serial.begin(9600);     // opens serial port, sets data rate to 9600 bps
        pinMode(9, OUTPUT);
        digitalWrite(9, LOW);
        pinMode(10,OUTPUT);
        digitalWrite(10, LOW);
        pinMode(11, OUTPUT);
        digitalWrite(11, LOW);
        pinMode(12, OUTPUT);
        digitalWrite(11, LOW);
        // preview
        pinMode(6, OUTPUT);
        digitalWrite(6, LOW);
        pinMode(5, OUTPUT);
        digitalWrite(5, LOW);
        pinMode(4, OUTPUT);
        digitalWrite(4, LOW);
        pinMode(3, OUTPUT);
        digitalWrite(3, LOW);
        pinMode(A1, INPUT);
        pinMode(A2, INPUT);
        pinMode(A3, INPUT);
}

void loop() {

        // send data only when you receive data:
        if (Serial.available() > 0) {
                // read the incoming byte:
                preview = Serial.read();

                // say what you got:
                ;
                Serial.println(preview);
        }
 //Everything that is greyed out is to control the program led which is now not needed, if you decide to enable manual control
 //of the program leds, change either the preview call number(which number you press to turn on the led)
        /* LED 1 */
  /*    if (preview == '1' || preview == 'g' || preview == 'G') //change this number (preview == '1')
        {
          digitalWrite(12, HIGH); //sets camera 1 led to program
          digitalWrite(11, LOW);  //sets camera 2 led to off
          digitalWrite(10, LOW);  //sets camera 3 led to off
          digitalWrite(9, LOW);   //sets camera 4 led to off
          
        }
        /* LED 2 */
  /*     if (preview == '2' || preview == 'h' || preview == 'H')
        {
          digitalWrite(11, HIGH);
          digitalWrite(12, LOW);
          digitalWrite(10, LOW);
          digitalWrite(9, LOW);
          
        }
        /* LED 3 */
  /*    if (preview == '3' || preview == 'j' || preview == 'J')
        {
          digitalWrite(10, HIGH);
          digitalWrite(11, LOW);
          digitalWrite(12, LOW);
          digitalWrite(9, LOW);
        }
         /* LED 4 */
   /*    if (preview == '4' || preview == 'k' || preview == 'K')
        {
          digitalWrite(9, HIGH);
          digitalWrite(11, LOW);
          digitalWrite(10, LOW);
          digitalWrite(12, LOW);
          
        }
        


// PREVIEW

        /* LED 1 */        
        if (preview == '1')               //change this number if you enable manual control of program led
        {
          cam1 = '1';                     //manually sets camera 1 to preview state
          cam2 = '0';                     //manually sets camera 2 to off or no preview
          cam3 = '0';                     //manually sets camera 3 to off or no preview
          cam4 = '0';                     //manually sets camera 4 to off or no preview
        }

        /* LED 2 */        
        if (preview == '2')
        {
          cam1 = '0';
          cam2 = '1';
          cam3 = '0';
          cam4 = '0';
        }

        /* LED 3 */        
        if (preview == '3')
        {
          cam1 = '0';
          cam2 = '0';
          cam3 = '1';
          cam4 = '0';
        }

        /* LED 4 */        
        if (preview == '4')
        {
          cam1 = '0';
          cam2 = '0';
          cam3 = '0';
          cam4 = '1';

        }
        if (cam4 == '1'){ //waits for variables state to be changed
          digitalWrite(6, HIGH); //turns on camera 4s preview led and turns off the rest
          digitalWrite(4, LOW);
          digitalWrite(5, LOW);
          digitalWrite(3, LOW);
        }
        if (cam3 == '1'){
          digitalWrite(5, HIGH);
          digitalWrite(3, LOW);
          digitalWrite(4, LOW);
          digitalWrite(6, LOW);
        }
        if (cam2 == '1'){
          digitalWrite(5, LOW);
          digitalWrite(3, LOW);
          digitalWrite(4, HIGH);
          digitalWrite(6, LOW);
        }
        if (cam1 == '1'){
          digitalWrite(6, LOW);
          digitalWrite(5, LOW);
          digitalWrite(4, LOW);
          digitalWrite(3, HIGH);
        }
        if (cam1 == '0'){
          digitalWrite(3, LOW);
        }
        if (cam2 == '0'){
          digitalWrite(4, LOW);
        }
        if (cam3 == '0'){
          digitalWrite(5, LOW);
        }
        if (cam4 == '0'){
          digitalWrite(6, LOW);
        }
        if (prgm1 == '1'){
          digitalWrite(9, HIGH); //turns on live camera led
          digitalWrite(10, LOW);
          digitalWrite(11, LOW);
          digitalWrite(12, LOW);
        }else{
          digitalWrite(9, LOW); //turns off when not in use
        }
        if (prgm2 == '1'){
          digitalWrite(10, HIGH);
          digitalWrite(12, LOW);
          digitalWrite(11, LOW);
          digitalWrite(9, LOW);
        }else{
          digitalWrite(10, LOW);
        }
        if (prgm3 == '1'){
          digitalWrite(12, LOW);
          digitalWrite(11, HIGH);
          digitalWrite(10, LOW);
          digitalWrite(9, LOW);
        }else{
          digitalWrite(11, LOW);
        }
        if (prgm4 == '1'){
          digitalWrite(12, HIGH);
          digitalWrite(11, LOW);
          digitalWrite(10, LOW);
          digitalWrite(9, LOW);
        }else{
          digitalWrite(12, LOW);
        }
        if (preview == 'c'){
          if (cam1 == '1'){
            if (prgm2 == '1'){
              prgm1 = '1'; //turns on camera 1s live LED
              prgm2 = '0'; //turns off camera 2s live LED
              cam1 = '0'; //turns off camera 1s preview LED
              cam2 = '1'; //turns on camera 2s preview LED
            }else if (prgm3 == '1'){
              prgm1 = '1';
              prgm3 = '0';
              cam3 = '1';
              cam1 = '0';
              
            }else if (prgm4 == '1'){
              prgm1 = '1';
              prgm4 ='0';
              cam1 = '0';
              cam4 = '1';
            }
          }else if (cam2 == '1'){
            if (prgm1 == '1'){
              prgm2 = '1';
              prgm1 = '0';
              cam1 = '1';
              cam2 = '0';
            }else if (prgm3 == '1'){
              prgm2 = '1';
              prgm3 = '0';
              cam3 = '1';
              cam2 = '0';
            }else if (prgm4 == '1'){
              prgm2 = '1';
              prgm4 = '0';
              cam4 = '1';
              cam2 = '0';
            }
          }else if (cam3 == '1'){
            if (prgm1 == '1'){
              prgm3 = '1';
              prgm1 = '0';
              cam3 = '0';
              cam1 = '1';
            }else if (prgm2 == '1'){
              prgm3 = '1';
              prgm2 = '0';
              cam2 = '0';
              cam3 = '1';
            }else if (prgm4 == '1'){
              prgm3 = '1';
              prgm4 = '0';
              cam4 = '1';
              cam3 = '0';
            }
          }else if (cam4 == '1'){
            if (prgm1 == '1'){
              prgm4 = '1';
              prgm1 = '0';
              cam1 = '1';
              cam4 = '0';
            }else if (prgm2 == '1'){
              prgm4 = '1';
              prgm2 = '0';
              cam2 = '1';
              cam4 = '0';
            }else if (prgm3 == '1'){
              prgm4 = '1';
              prgm3 = '0';
              cam3 = '1';
              cam4 = '0';
            }
          }
        }else if (preview == 's'){
          prgm2 = '1';
        }
}

@MCDran

Other post/duplicate DELETED
Please do NOT cross post / duplicate as it wastes peoples time and efforts to have more than one post for a single topic.

Continued cross posting could result in a time out from the forum.

Could you take a few moments to Learn How To Use The Forum.
It will help you get the best out of the forum in the future.
Other general [help and troubleshooting advice can be found here./url