<!-- language-all: lang-C++ -->

    void loop() { 
      Serial.println("NEW-------------");
      int x;
      int y[100];
      for(int i = 0; i<100; i++){ 
        x=RX.read(); 
        y[i] = x;
      } 
    ...
    }

You are reading data without checking if there is any data there. That's like watching the TV without checking if it is turned on. Of course you get weird data.

---

    SoftwareSerial RX(0,1); //(rx pin, tx pin)

Pins 0 and 1 are used by HardwareSerial. Why are you using them for SoftwareSerial?

---

    SoftwareSerial RX(0,1); //(rx pin, tx pin)
    ...

      Serial.begin(9600); 
      RX.begin(1200); 

So you initialized HardwareSerial, which now controls pins 0 and 1.

Then you try to initialize SoftwareSerial on those **same** pins! Would you mind explaining why?

Whatever your explanation is, it won't work.


---

> I've added in the changes you mentioned, but the data still seems to be skewed.

You've changed things, for sure:

     for(int i = 0; i<100; i++){ 
        if(RX.available())
          x=RX.read(); 
    
        y[i] = x;
        }

Let's see. In a loop of 100 iterations you see if anything is available (and if so, put it into `x`).

Then, regardless of **whether or not you got anything** you now assign `x` to `y[i]`. So, most of the time, `y[i]` will have garbage in it.

>  the data still seems to be skewed

Not surprised. Do it differently. Only write to the array if you have data. In fact you may want a complete rework. Read this:

[How to read serial without blocking](http://www.gammon.com.au/serial)

---

>  I have posted the amended code. Change: Only add to the array is data is being read from buffer.


      int y[100];
      for(int i = 0; i<100; i++){ 
        if(RX.available())
        {
          x=RX.read(); 
          y[i] = x;
        }
      } 
    
     for (int j = 1; j<=64; j++){ 
        Serial.println(y[j]);
      } 

You still have not fixed it. Let me talk you through what it is doing now.

You are making 100 attempts to read some data. One or two may succeed, and they will be put into the buffer `y` (funny name for a buffer, right?).

So imagine `.` is garbage and `X` is good data, after doing that loop of 100 the buffer will look like this:

    ........X...........X...........X...X......................X.............................................

So your buffer is still 80% unchanged garbage. Then you print the first 64 elements (why 64 and not 100?) and you get a lot of garbage out. Exactly as expected.

---

You need to think about what you are doing. Draw it out on a bit of paper, perhaps.

Here is some example code from the page I linked for you, more than once. Please compare:

    // how much serial data we expect before a newline
    const unsigned int MAX_INPUT = 50;
    
    void setup ()
      {
      Serial.begin (115200);
      } // end of setup
    
    // here to process incoming serial data after a terminator received
    void process_data (const char * data)
      {
      // for now just display it
      // (but you could compare it to some value, convert to an integer, etc.)
      Serial.println (data);
      }  // end of process_data
      
    void processIncomingByte (const byte inByte)
      {
      static char input_line [MAX_INPUT];
      static unsigned int input_pos = 0;
    
      switch (inByte)
        {
    
        case '\n':   // end of text
          input_line [input_pos] = 0;  // terminating null byte
          
          // terminator reached! process input_line here ...
          process_data (input_line);
          
          // reset buffer for next time
          input_pos = 0;  
          break;
    
        case '\r':   // discard carriage return
          break;
    
        default:
          // keep adding if not full ... allow for terminating null byte
          if (input_pos < (MAX_INPUT - 1))
            input_line [input_pos++] = inByte;
          break;
    
        }  // end of switch
       
      } // end of processIncomingByte  
    
    void loop()
      {
      // if serial data available, process it
      while (Serial.available () > 0)
        processIncomingByte (Serial.read ());
        
      // do other stuff here like testing digital input (button presses) ...
    
      }  // end of loop