LCD Pixel sequence error

#include "SPI.h"
#include "ILI9341_due_config.h"
#include "ILI9341_due.h"
#include "info.h"
#include "close.h"
#include "Arduino.h" 


#include "fonts\SystemFont5x7.h"       // system font
#include "fonts\Arial14.h"             // proportional font
#include "fonts\Arial_bold_14.h"       // Bold proportional font
#include "fonts\Corsiva_12.h"
#include "fonts\Verdana_digits_24.h"   // large proportional font - numerals only 
#include "fonts\fixednums7x15.h"       // fixed width font - numerals only 
#include "fonts\fixednums8x16.h"       // fixed width font - numerals only 
#include "fonts\fixednums15x31.h"      // fixed width font - numerals only 
#include "fonts\helvNeueTh70.h"
#include "fonts\jokerman_255.h"
#include "fonts\roboto16.h"
#include "fonts\roboto32.h"
#include "fonts\roboto70nums.h"


#define LCD_CS 10	// Chip Select for LCD
#define LCD_DC 9	// Command/Data for LCD
#define LCD_RST 8	// Reset for LCD

   
byte PixelArray[128]; 
byte PixelArrai[128]; 
int CLK = 22;
int SI  = 13;
int i   =  0;
int j   =  0; 
uint32_t sensorValue = 0;
int a = 0;

ILI9341_due tft(LCD_CS, LCD_DC, LCD_RST);

void drawLineByAngle(int16_t x, int16_t y, int16_t angle, uint16_t start, uint16_t length, uint16_t color);
void drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color);


  
  void setup()
  {     
  //  SPI.begin();
  //  SPI.setClockDivider(SPI_CLOCK_DIV128);
  Serial.begin(500000); 
  
  	pinMode(CLK, OUTPUT);
    pinMode(SI, OUTPUT);
    
    digitalWrite(SI, HIGH);                                
    digitalWrite(CLK, HIGH);                              
    digitalWrite(SI, LOW);                               
    digitalWrite(CLK, LOW);
    for(i = 0; i < 128; i ++)
    {                         
    ClockPulse();       
    }
  	tft.begin();
  	tft.setRotation(iliRotation0);	// landscape
//    tft.drawImage(intro, 0, 0, introWidth, introHeight);
//    delay(2500);
    tft.fillScreen(ILI9341_DARKBLUE);
    //tft.setSPIClockDivider(2); 
    //tft.fillRect(129, 0, 191, 240, ILI9341_BLACK);
    //tft.fillRect(130, 1, 189, 20, tft.color565(0,0,50));     
   }
   void ClockPulse()
  {
    delayMicroseconds(0.001);
    digitalWrite(CLK, HIGH);
    delayMicroseconds(0.001);
    digitalWrite(CLK, LOW);
  }
  
  void loop()
  {    
  image();        
  }
 
  void image()
  {
    a++;  
    if(a == 320)
    {
      a = 0;
    }
    
   digitalWrite(SI, HIGH);      
   digitalWrite(CLK, HIGH);  
   digitalWrite(SI, LOW); 
   digitalWrite(CLK, LOW); 
  
   for(i = 0; i < 128; i++)
   {                                       
    delayMicroseconds(0.001); 
    PixelArray[i] = analogRead(A0) ;
    PixelArrai[i] = analogRead(A5) ;                                                          
    ClockPulse();
    } 
    for(i = 0; i < 120; i++)
    {    
   tft.drawPixel(i, a, tft.color565(PixelArray[i],PixelArray[i],PixelArray[i]));      
    }    
    for(j = 120; j < 240; j++)
    {    
    tft.drawPixel(j, a, tft.color565(PixelArrai[i],PixelArrai[i],PixelArrai[i]));  
    }
  }

What is the problem ? Not aligned after 120 pixels

What is the problem ?

No code tags.

fault image;

I see the picture, but you have not identified what is wrong with it.

Paul

this line is not working;

for(j = 120; j < 240; j ++)
  
{    

   tft.drawPixel(j, a, tft.color565(PixelArrai,PixelArrai,PixelArrai));  //****This is Not working***


}
byte PixelArray[128]; 
byte PixelArrai[128];
 PixelArray = analogRead(A0) ;

whoops!

BulldogLowell:

byte PixelArray[128]; 

byte PixelArrai[128];






PixelArray = analogRead(A0) ;




whoops!

See reply #1

what is the problem ?

Maceraperest:
what is the problem ?

Something is "not working", whatever that means.

AWOL:
No code tags.

No setup() function.
No loop() function.
No variable declarations / definitions
No #include statements
Undefined functions
etc.

byte PixelArray[128]; 
byte PixelArrai[128]; 
int CLK = 22;
int SI  = 13;
int i   =  0;
int j   =  0; 

void setup()
 {     


 
   pinMode(CLK, OUTPUT);
   pinMode(SI, OUTPUT);
   
   digitalWrite(SI, HIGH);                                
   digitalWrite(CLK, HIGH);                              
   digitalWrite(SI, LOW);                               
   digitalWrite(CLK, LOW);
   for(i = 0; i < 128; i ++)
   {                         
   ClockPulse();       
   }
  tft.begin();
  tft.setRotation(iliRotation0);

   tft.fillScreen(ILI9341_DARKBLUE);

  }
  void ClockPulse()
 {
   delayMicroseconds(0.001);
   digitalWrite(CLK, HIGH);
   delayMicroseconds(0.001);
   digitalWrite(CLK, LOW);
 }
 
 void loop()
 {    
 image();        
 }

 void image()
 {
   a++;  
   if(a == 320)
   {
     a = 0;
   }
  digitalWrite(SI, HIGH);      
  digitalWrite(CLK, HIGH);  
  digitalWrite(SI, LOW); 
  digitalWrite(CLK, LOW); 
 
  for(i = 0; i < 128; i++)
  {                                       
   delayMicroseconds(0.001); 
   PixelArray[i] = analogRead(A0) ;
   PixelArrai[i] = analogRead(A1) ;                                                          
   ClockPulse();
   } 
   for(i = 0; i < 120; i++)
   {    
   tft.drawPixel(i, a, tft.color565(PixelArray[i],PixelArray[i],PixelArray[i]));  
   }    
   for(j = 120; j < 240; j++)
   {  
   PixelArrai[i] = analogRead(A1) ;                                                          
   ClockPulse();  
   tft.drawPixel(j, a, tft.color565(PixelArrai[i],PixelArrai[i],PixelArrai[i]));  
   }
 }

the error picture has been updated,

Still no code tags.

this resolves to a pointer:

PixelArray

this returns an int:

analogRead(A0)

see any problem with that?

how to turn.

Maceraperest:
how to turn.

start with a working example sketch for your TFT display... there are innumerable issues with your code as it is.

#include "SPI.h"
#include "ILI9341_due_config.h"
#include "ILI9341_due.h"
#include "info.h"
#include "close.h"
#include "Arduino.h" 


#include "fonts\SystemFont5x7.h"       // system font
#include "fonts\Arial14.h"             // proportional font
#include "fonts\Arial_bold_14.h"       // Bold proportional font
#include "fonts\Corsiva_12.h"
#include "fonts\Verdana_digits_24.h"   // large proportional font - numerals only 
#include "fonts\fixednums7x15.h"       // fixed width font - numerals only 
#include "fonts\fixednums8x16.h"       // fixed width font - numerals only 
#include "fonts\fixednums15x31.h"      // fixed width font - numerals only 
#include "fonts\helvNeueTh70.h"
#include "fonts\jokerman_255.h"
#include "fonts\roboto16.h"
#include "fonts\roboto32.h"
#include "fonts\roboto70nums.h"


#define LCD_CS 10	// Chip Select for LCD
#define LCD_DC 9	// Command/Data for LCD
#define LCD_RST 8	// Reset for LCD

   
byte PixelArray[128]; 
byte PixelArrai[128]; 
int CLK = 22;
int SI  = 13;
int i   =  0;
int j   =  0; 
uint32_t sensorValue = 0;
int a = 0;

ILI9341_due tft(LCD_CS, LCD_DC, LCD_RST);

void drawLineByAngle(int16_t x, int16_t y, int16_t angle, uint16_t start, uint16_t length, uint16_t color);
void drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color);


  
  void setup()
  {     
  //  SPI.begin();
  //  SPI.setClockDivider(SPI_CLOCK_DIV128);
  Serial.begin(500000); 
  
  	pinMode(CLK, OUTPUT);
    pinMode(SI, OUTPUT);
    
    digitalWrite(SI, HIGH);                                
    digitalWrite(CLK, HIGH);                              
    digitalWrite(SI, LOW);                               
    digitalWrite(CLK, LOW);
    for(i = 0; i < 128; i ++)
    {                         
    ClockPulse();       
    }
  	tft.begin();
  	tft.setRotation(iliRotation0);	// landscape
//    tft.drawImage(intro, 0, 0, introWidth, introHeight);
//    delay(2500);
    tft.fillScreen(ILI9341_DARKBLUE);
    //tft.setSPIClockDivider(2); 
    //tft.fillRect(129, 0, 191, 240, ILI9341_BLACK);
    //tft.fillRect(130, 1, 189, 20, tft.color565(0,0,50));     
   }
   void ClockPulse()
  {
    delayMicroseconds(0.001);
    digitalWrite(CLK, HIGH);
    delayMicroseconds(0.001);
    digitalWrite(CLK, LOW);
  }
  
  void loop()
  {    
  imagee();        
  }
 
  void image()
  {
    a++;  
    if(a == 320)
    {
      a = 0;
    }
    
   digitalWrite(SI, HIGH);      
   digitalWrite(CLK, HIGH);  
   digitalWrite(SI, LOW); 
   digitalWrite(CLK, LOW); 
  
   for(i = 0; i < 128; i++)
   {                                       
    delayMicroseconds(0.001); 
    PixelArray[i] = analogRead(A0) ;
    PixelArrai[i] = analogRead(A1) ;                                                          
    ClockPulse();
    } 
    for(i = 0; i < 120; i++)
    {    
   tft.drawPixel(i, a, tft.color565(PixelArray[i],PixelArray[i],PixelArray[i]));      
    }    
    for(j = 120; j < 240; j++)
    {    
    tft.drawPixel(j, a, tft.color565(PixelArrai[i],PixelArrai[i],PixelArrai[i]));  
    }
  }
  void imagee()
  {
    a++;  
    if(a == 320)
    {
      a = 0;
    }    
   digitalWrite(SI, HIGH);      
   digitalWrite(CLK, HIGH);  
   digitalWrite(SI, LOW); 
   digitalWrite(CLK, LOW); 
  
   for(i = 0; i < 128; i++)
   {                                       
    delayMicroseconds(0.001);     
    PixelArrai[i] = analogRead(A0) ;                                                          
    ClockPulse();
    } 
    for(i = 0; i < 120; i++)
    {    
   tft.drawPixel(i, a, tft.color565(PixelArrai[i],PixelArrai[i],PixelArrai[i]));      
    }      
  }

Maceraperest:

#include "SPI.h"

#include "ILI9341_due_config.h"
//...

so, this is totally different than what you previously posted.

What does this supposed to represent?

How can you expect help if you cannot bring yourself to give more information about your issues?

does it even compile?

what happens?

there is no compilation problem, the problem is not a placement between 120 and 240 pixels

 for(j = 120; j < 240; j++)
    {    
    tft.drawPixel(j, a, tft.color565(PixelArrai[i],PixelArrai[i],PixelArrai[i]));  
    }

    delayMicroseconds(0.001);

What kind of argument does this function take?

What, exactly, do you expect to be in elements 128-239 of PixelArray[] and PixelArrai[] given that you only defined them with 128 elements?

delayMicroseconds(0.001);

Seriously? A 1 ns delay? Unlikely even if delayMicroseconds() took float arguments, which it doesn’t.