Help understanding my monitor output

I have used 3 4021 registers and a mega board, but the rest of the program is the one from the tutorial. all my switches are pull down with 10k per the tutorial,. My problem is that in my serial monitor all i get is 1’s no regardless of switch position, i have measured no input voltage at the pins yet the software says theyre high!!!( i think am i reading it wrong?) my serial monitor is
11111111
11111111
11111111
repeating help pls.

//define where your pins are
int latchPin = 23;
int dataPin = 24;
int clockPin = 22;

//Define variables to hold the data 
//for each shift register.
//starting with non-zero numbers can help
//troubleshoot
byte switchVar1 = 61;  //00111101
byte switchVar2 = 122; //01111010
byte switchVar3 = 183; //10110111

void setup() {
  //start serial
  Serial.begin(9600);

  //define pin modes
  pinMode(latchPin, OUTPUT);
  pinMode(clockPin, OUTPUT); 
  pinMode(dataPin, INPUT);

}

void loop() {

  //Pulse the latch pin:
  //set it to 1 to collect parallel data
  digitalWrite(latchPin,1);
  //set it to 1 to collect parallel data, wait
  delayMicroseconds(20);
  //set it to 0 to transmit data serially  
  digitalWrite(latchPin,0);

  //while the shift register is in serial mode
  //collect each shift register into a byte
  //the register attached to the chip comes in first 
  switchVar1 = shiftIn(dataPin, clockPin);
  switchVar2 = shiftIn(dataPin, clockPin);
  switchVar3 = shiftIn(dataPin, clockPin);

  //Print out the results.
  //leading 0's at the top of the byte 
  //(7, 6, 5, etc) will be dropped before 
  //the first pin that has a high input
  //reading  
  Serial.println(switchVar1, BIN);
  Serial.println(switchVar2, BIN);
  Serial.println(switchVar3, BIN);

//white space
Serial.println("-------------------");
//delay so all these print satements can keep up. 
delay(500);

}

//------------------------------------------------end main loop

////// ----------------------------------------shiftIn function
///// just needs the location of the data pin and the clock pin
///// it returns a byte with each bit in the byte corresponding
///// to a pin on the shift register. leftBit 7 = Pin 7 / Bit 0= Pin 0

byte shiftIn(int myDataPin, int myClockPin) { 
  int i;
  int temp = 0;
  int pinState;
  byte myDataIn = 0;

  pinMode(myClockPin, OUTPUT);
  pinMode(myDataPin, INPUT);

//we will be holding the clock pin high 8 times (0,..,7) at the
//end of each time through the for loop

//at the begining of each loop when we set the clock low, it will
//be doing the necessary low to high drop to cause the shift
//register's DataPin to change state based on the value
//of the next bit in its serial information flow.
//The register transmits the information about the pins from pin 7 to pin 0
//so that is why our function counts down
  for (i=7; i>=0; i--)
  {
    digitalWrite(myClockPin, 0);
    delayMicroseconds(2);
    temp = digitalRead(myDataPin);
    if (temp) {
      pinState = 1;
      //set the bit to 0 no matter what
      myDataIn = myDataIn | (1 << i);
    }
    else {
      //turn it off -- only necessary for debuging
     //print statement since myDataIn starts as 0
     // pinState = 0;
    }

    //Debuging print statements
    //Serial.print(pinState);
    //Serial.print("     ");
    //Serial.println (dataIn, BIN);

    //digitalWrite(myClockPin, 1);

  }
  //debuging print statements whitespace
  //Serial.println();
  //Serial.println(myDataIn, BIN);
 /// return myDataIn;
}

Considered starting with just one 4021?
How about slowing things down, millisecs instead of microsecs (data latch, clock transitions)?

The data out (Q8) advances/progresses as a result of positive-going transitions.

It would help if you would draw your circuit out, take a clear picture of that, and post it (assuming you don't have some circuit rendering s/w.) Then I, or somebody else, can "red line" mark that up for you.

Well ive actually made real good progress so far i think. my problem in the code from the shiftin tutorial was there was no MSBFIRST in the shiftin command(got that form the shiftout tutorial). Ive managed to get meaningful data and changed it to DEC from BIN cause its easier for me to read. I can read 23 of 24 inputs, i understand the 8th switch on the second chip sends it data to the 8th sw. out on the first chip, but where does the the data from the 8th sw. input on the first chip go??? Ive seriously modified my code since i posted it last, adding case outputs to relays. Is there a better way to determine all possible sw. positions on a chip than what ive done??? It works but is was alot of writing. Had to cut most of it out it was to long lol

//define where your pins are
int latchPin = 23;
int dataPin = 24;
int clockPin = 22;
int m1a = 26;
int m1b = 27;
int m2a = 28;
int m2b = 29;
int m3a = 30;
int m3b = 31;
int m4a = 33;
int m4b = 34;
int m5a = 35;
int m5b = 36;
int m6a = 37;
int m6b = 38;
int m7a = 39;
int m7b = 40;
int m8a = 41;
int m8b = 42;
int m9a = 43;
int m9b = 44;
int m10a = 45;
int m10b = 46;
int m11a = 47;
int m11b = 48;
int m12a = 49;
int m12b = 50;
 
//Define variables to hold the data 
//for each shift register.
//starting with non-zero numbers can help
//troubleshoot
byte switchVar1 = 61;  //00111101
byte switchVar2 = 122; //01111010
byte switchVar3 = 183; //10110111

void setup() {
  //start serial
  Serial.begin(9600);

  //define pin modes
  pinMode(latchPin, OUTPUT);
  pinMode(clockPin, OUTPUT); 
  pinMode(dataPin, INPUT);
  pinMode(m1a, OUTPUT);
  pinMode(m1b, OUTPUT);
  pinMode(m2a, OUTPUT);
  pinMode(m2b, OUTPUT);
  pinMode(m3a, OUTPUT);
  pinMode(m3b, OUTPUT);
  pinMode(m4a, OUTPUT);
  pinMode(m4a, OUTPUT);
  pinMode(m5a, OUTPUT);
  pinMode(m5b, OUTPUT);
  pinMode(m6a, OUTPUT);
  pinMode(m6b, OUTPUT);
  pinMode(m7a, OUTPUT);
  pinMode(m7b, OUTPUT);
  pinMode(m8a, OUTPUT);
  pinMode(m8b, OUTPUT);
  pinMode(m9a, OUTPUT);
  pinMode(m9b, OUTPUT);
  pinMode(m10a, OUTPUT);
  pinMode(m10b, OUTPUT);
  pinMode(m11a, OUTPUT);
  pinMode(m11b, OUTPUT);
  pinMode(m12a, OUTPUT);
  pinMode(m12b, OUTPUT);
  

}

void loop() {

  //Pulse the latch pin:
  //set it to 1 to collect parallel data
  digitalWrite(latchPin,1);
  //set it to 1 to collect parallel data, wait
  delayMicroseconds(20);
  //set it to 0 to transmit data serially  
  digitalWrite(latchPin,0);

  //while the shift register is in serial mode
  //collect each shift register into a byte
  //the register attached to the chip comes in first 
  switchVar1 = shiftIn(dataPin, clockPin, MSBFIRST);
  switchVar2 = shiftIn(dataPin, clockPin, MSBFIRST);
  switchVar3 = shiftIn(dataPin, clockPin, MSBFIRST);






  //Print out the results.
  //leading 0's at the top of the byte 
  //(7, 6, 5, etc) will be dropped before 
  //the first pin that has a high input
  //reading  
  Serial.println(switchVar1,DEC);
  Serial.println(switchVar2, DEC);
  Serial.println(switchVar3, DEC);


//white space
Serial.println("-------------------");
//delay so all these print satements can keep up. 
delay(500);

 

switch (switchVar1) {
  
  case 1:
  digitalWrite(m8b, HIGH);
  break;
  
  case 2:
  digitalWrite(m1a, HIGH);
  break;
  
  case 4:
  digitalWrite(m1b, HIGH);
  break;
  
  case 8:
  digitalWrite(m2a, HIGH);
  break;
  
 
  
  case 162:
  digitalWrite(m9a, HIGH);
  digitalWrite(m11a, HIGH);
  digitalWrite(m12a, HIGH);
  break;
  
  case 194:
  digitalWrite(m9a, HIGH);
  digitalWrite(m11b, HIGH);
  digitalWrite(m12a, HIGH);
  break;
  
  case 164:
  digitalWrite(m9b, HIGH);
  digitalWrite(m11a, HIGH);
  digitalWrite(m12a, HIGH);
  break;
  
  case 196:
  digitalWrite(m9b, HIGH);
  digitalWrite(m11b, HIGH);
  digitalWrite(m12a, HIGH);
  break;
  
  case 168:
  digitalWrite(m10a, HIGH);
  digitalWrite(m11a, HIGH);
  digitalWrite(m12a, HIGH);
  break;
  
  case 200:
  digitalWrite(m10a, HIGH);
  digitalWrite(m11b, HIGH);
  digitalWrite(m12a, HIGH);
  break;
  
  case 176:
  digitalWrite(m10b, HIGH);
  digitalWrite(m11a, HIGH);
  digitalWrite(m12a, HIGH);
  break;
  
  case 206:
  digitalWrite(m10b, HIGH);
  digitalWrite(m11b, HIGH);
  digitalWrite(m12a, HIGH);
  break;
  
  
  ///4button-8
  
  case 170:
  digitalWrite(m9a, HIGH);
  digitalWrite(m10a, HIGH);
  digitalWrite(m11a, HIGH);
  digitalWrite(m12a, HIGH);
  break;
  
  case 202:
  digitalWrite(m9a, HIGH);
  digitalWrite(m10a, HIGH);
  digitalWrite(m11b, HIGH);
  digitalWrite(m12a, HIGH);
  break;
  
  case 178:
  digitalWrite(m9a, HIGH);
  digitalWrite(m10b, HIGH);
  digitalWrite(m11a, HIGH);
  digitalWrite(m12a, HIGH);
  break;
  
  case 210:
  digitalWrite(m9a, HIGH);
  digitalWrite(m10b, HIGH);
  digitalWrite(m11b, HIGH);
  digitalWrite(m12a, HIGH);
  break;
  
  case 172:
  digitalWrite(m9b, HIGH);
  digitalWrite(m10a, HIGH);
  digitalWrite(m11a, HIGH);
  digitalWrite(m12a, HIGH);
  break;
  
  case 204:
  digitalWrite(m9b, HIGH);
  digitalWrite(m10a, HIGH);
  digitalWrite(m11b, HIGH);
  digitalWrite(m12a, HIGH);
  break;
  
  case 180:
  digitalWrite(m9b, HIGH);
  digitalWrite(m10b, HIGH);
  digitalWrite(m11a, HIGH);
  digitalWrite(m12a, HIGH);
  break;
  
  case 212:
  digitalWrite(m9b, HIGH);
  digitalWrite(m10b, HIGH);
  digitalWrite(m11b, HIGH);
  digitalWrite(m12a, HIGH);
  break;
  

  
  
  
  
   case 0:
  digitalWrite(m9a, LOW);
  digitalWrite(m9b, LOW);
  digitalWrite(m10a, LOW);
  digitalWrite(m10b, LOW);
  digitalWrite(m11a, LOW);
  digitalWrite(m11b, LOW);
  digitalWrite(m12a, LOW);
  
  break;
    
  

  
    
  
} 
}







//------------------------------------------------end main loop

////// ----------------------------------------shiftIn function
///// just needs the location of the data pin and the clock pin
///// it returns a byte with each bit in the byte corresponding
///// to a pin on the shift register. leftBit 7 = Pin 7 / Bit 0= Pin 0

byte shiftIn(int myDataPin, int myClockPin) { 
  int i;
  int temp = 0;
  int pinState;
  byte myDataIn = 0;

  pinMode(myClockPin, OUTPUT);
  pinMode(myDataPin, INPUT);

//we will be holding the clock pin high 8 times (0,..,7) at the
//end of each time through the for loop

//at the begining of each loop when we set the clock low, it will
//be doing the necessary low to high drop to cause the shift
//register's DataPin to change state based on the value
//of the next bit in its serial information flow.
//The register transmits the information about the pins from pin 7 to pin 0
//so that is why our function counts down
  for (i=7; i>=0; i--)
  {
    digitalWrite(myClockPin, 0);
    delayMicroseconds(2);
    temp = digitalRead(myDataPin);
    if (temp) {
      pinState = 1;
      //set the bit to 0 no matter what
      myDataIn = myDataIn | (1 << i);
    }
    else {
      //turn it off -- only necessary for debuging
     //print statement since myDataIn starts as 0
     // pinState = 0;
    }

    //Debuging print statements
    //Serial.print(pinState);
    //Serial.print("     ");
    //Serial.println (dataIn, BIN);

    //digitalWrite(myClockPin, 1);

  }
  //debuging print statements whitespace
  //Serial.println();
  //Serial.println(myDataIn, BIN);
 /// return myDataIn;
}

offroadchev:
I can read 23 of 24 inputs, i understand the 8th switch on the second chip sends it data to the 8th sw. out on the first chip, but where does the the data from the 8th sw. input on the first chip go?

Isn't Q8 (IC pin3) of one going to "Serial" (IC pin11) of the next?

Yes from the third to the second, and the second to the first, buti get nothing from the 8th sw. From the first ic. I can read the 8th sw on the third ic as a 1 out put on the second ic and same for second to first, but where does ic1 sw 8 output?

offroadchev:
...but where does ic1 sw 8 output?

Isn't the first (or last, however you figure) output register available/present at the output without a dataclock? Then you need 23 dataclock-and-read cycles following?

In a noob sry and dont get what your saying sry.

In my serial monitor with alll switches off i get all 0’s. As switches turn on and off i get the data i expect to show up in DEC and use those numbers to turn on relays. Is there a way to start with all -1’s??? cause i think that last switch on ic1 is sending a 0 but i cant see it…