TSL 1401 line scanner

I am really struggling to use the parallax TSL 1401 line scanner with my Arduino uno R3 along with the BOE shield. I have managed to get it working with the working with an oscilloscope, so now I am trying to have it read a barcode by saving the data onto the internal EEPROM. The code I have posted here

#include <EEPROM.h>
byte value;
#define opened 13
int addr = 0;
int Initiate = 0;
int verify = 0;

#define CLK   2   //camera clock input is connected to pin 2 of arduino.  
#define SI 3   
#define Aout A0  
unsigned int captpix[128];             //FOR STORE THE DIFFENTS VALUES OF EACH PIXEL.  
void setup()  
{   
pinMode(CLK,OUTPUT); 
pinMode(SI,OUTPUT); 
pinMode(Aout,INPUT);        //THE ANALOG OUTPUT OF THE CAMERA is connected to the arduino board. 
Serial.begin(9600);         // IF YOU WANT TO SEE THE ANALOG OPPUTS VALUES OF THE CAMERA OF EACH PIXEL 
 } 
/************************************************************************/  
 
 // WITH THIS FUNCTION YOU CAN SEE THE CAMERA'S ANALOG OUTPUT IN THE OSCILLOSCOPE. YOU CAN WATCH MY VIDEO IN MY YOUTUBE CHANNEL. see page 5 of the datasheet, figure 1 and 2. 
 void timming(void) 
 { 
    
   int time=170; 
   digitalWrite(SI, HIGH); 
   delayMicroseconds(time/2); 
   digitalWrite(CLK, HIGH); 
   delayMicroseconds(time/2); 
   digitalWrite(SI, LOW);
   delayMicroseconds(time/2); 
   digitalWrite(CLK, LOW); 
   delayMicroseconds(time); 
 
 
   for(int contpixel=0;contpixel<128;contpixel++) 
   { 
     digitalWrite(CLK, HIGH); 
     delayMicroseconds(time); 
     digitalWrite(CLK, LOW); 
     delayMicroseconds(time); 
 
 
   } 
 
 
   digitalWrite(CLK, HIGH); 
   delayMicroseconds(time); 
   digitalWrite(CLK, LOW); 
   delayMicroseconds(time); 
 } 

 /************************************************************************/
 //WITH THIS FUNCTION THE CAMERA PROCESS THE ANALOG OUTPUT FOR MOVE THE SERVO. 
 // IS VERY IMPORTAND THAT YOU LOOK THAT I AM NOT USING TIMER INTERRUPTS IN THIS CODE, THIS CODE IS JUST FOR DEMOSTRATION. 
 // PREVIOUSLY I WILL FIX THIS CODE. AND I AM SORRY, BEACUSE EXPLAIN MY CODE FOR THIS MEDIUM IS VERY DIFFICULT. 
 void ADC_READ_CAMERA(void)   
 { 
    int addr = 0;
   int time=170; 
   digitalWrite(SI, HIGH); 
   delayMicroseconds(time/2); 
   digitalWrite(CLK, HIGH); 
   delayMicroseconds(time/2); 
   digitalWrite(SI, LOW); 
   delayMicroseconds(time/2); 
   digitalWrite(CLK, LOW); 
   delayMicroseconds(time); 
 
 
   for(int contpixel=0;contpixel<128;contpixel++) 
   { if (addr == EEPROM.length()){
      addr = 0;}
     else {digitalWrite(CLK, HIGH); 
     captpix[contpixel]=analogRead(Aout); 
     delayMicroseconds(time); 
     digitalWrite(CLK, LOW); 
     delayMicroseconds(time); 
    EEPROM.write(addr, (captpix[contpixel]/4));
    addr = addr+1;}}

    if (addr == 128){digitalWrite (13, HIGH);
      delay(1000);
      digitalWrite (13,LOW); 
       addr = 0;}}
  /************************************************************************/ 
 
 void confirm (void) {
  int same = 0;
 addr = 0;
 int time=170; 
   digitalWrite(SI, HIGH); 
   delayMicroseconds(time/2); 
   digitalWrite(CLK, HIGH); 
   delayMicroseconds(time/2); 
   digitalWrite(SI, LOW); 
   delayMicroseconds(time/2); 
   digitalWrite(CLK, LOW); 
   delayMicroseconds(time); 
 
 
   for(int contpixel=0;contpixel<128;contpixel++) 
   {  
     digitalWrite(CLK, HIGH); 
     captpix[contpixel]=analogRead(Aout); 
     delayMicroseconds(time); 
     digitalWrite(CLK, LOW); 
     delayMicroseconds(time);
  captpix[contpixel] = analogRead(Aout);
 if (captpix[contpixel] > (EEPROM.read(addr)-50) && captpix[contpixel]<(EEPROM.read(addr)+50)) {
 same = (same+1); addr = (addr+1);}
 else {addr = (addr+1);}} 
 
 if (same == 128) { digitalWrite (13, HIGH);
 delay(1000);
 digitalWrite (13,LOW);}}
 
  /************************************************************************/ 
  void loop()
  {       
   //timming();  // if this function is activated, dont active the ADC_READ_CAMERA() and impre() functions. use this function when the   
                  //A0 pin of the camera is connected to the oscilloscope. 
Initiate = digitalRead(5);
if (Initiate = HIGH) {
 ADC_READ_CAMERA();               // enable this function if you want the 128 output analog values in the serial monitor of arduino, but 
  }
  else {// if you use this function you can not see the analog output signal in the osiclloscope.
verify = digitalRead(6);
if (verify = HIGH) {confirm(); }}}

programs the scanner to first read the value of each pixel and save each value to individual addresses in the EEPROM. After saving the data of the code it first reads, a separate array compares those values to some fresh data read by the camera. If all 128 bits of data match the last code it read, it should set pin 13 high.
It seems like none of the arrays are working, because pin 13 is also programed to go high when addr in ADC_READ_CAMERA reaches 128, and addr increases regardless of the scan results. What might be wrong, do any of the if functions in this sketch stop the flow of sketch until they find a match, or are the arrays not correct?

   for(int contpixel=0;contpixel<128;contpixel++)
   { if (addr == EEPROM.length()){
      addr = 0;}

Code like this is a bitch to read.

   for(int contpixel=0;contpixel<128;contpixel++)
   {
      if (addr == EEPROM.length())
      {
         addr = 0;
      }

is much easier to read.

if (Initiate = HIGH) {

It's very unusual to see an assignment operator in an if statement that is structured properly.

Why are you saving the data in EEPROM? I can't see any reason to persist barcode data so it can be reused when the Arduino resets.

Your code layout still sucks. Your { placement is inconsistent - sometimes on a new line, where it belongs, and sometimes on the same line as the statement it goes with. That makes the code hard to read.

Multiple statements on one line make the code hard to read.

(Overuse) (of) (parentheses) (makes) (the) (code) (hard) (to) (read).

Not knowing how your switches are wired means that it is impossible to know whether the pin states are being read correctly.

It seems like

Such statements indicate that you've made no attempt to debug the code. You should KNOW, because you have Serial.print() statements, what is happening.

This sketch is designed for a security system, which uses barcodes to limit access. I save the code onto the EEPROM so it will not be erased when the board is reset.

That MIGHT make sense, once the code actually works. Until then, storing data in EEPROM just adds unnecessary complexity and many more points for failure.

When I only use Analog along with the first/main subsystem (ADC_READ_CAMERA) I can see an analog signal on my oscilloscope that makes sense.

Sorry, this does not make sense. There is NO analog anything happening in the ADC_READ_CAMERA() function, and NO use of the analog-to-digital converter.