Graphing sensor data using sd card

I figured I could just put one entry per file. I made a quick code where it opens two files on the sd card and sets an x and y variable to the value put into each file. Then it puts a dot on the screen at those coordinates. The problem is that although I have the value 420 in the x1.txt file and 210 in the y1.txt file the variables x and y do not get set to these values, they both get set to 42 somehow. Here is my code:

#include <SPI.h>
#include <SD.h>
#include <SPI.h>
#include "Adafruit_GFX.h"
#include "Adafruit_RA8875.h"


// Library only supports hardware SPI at this time
// Connect SCLK to UNO Digital #13 (Hardware SPI clock)
// Connect MISO to UNO Digital #12 (Hardware SPI MISO)
// Connect MOSI to UNO Digital #11 (Hardware SPI MOSI)
#define RA8875_INT 3
#define RA8875_CS 10
#define RA8875_RESET 9

Adafruit_RA8875 tft = Adafruit_RA8875(RA8875_CS, RA8875_RESET);
uint16_t tx, ty;

File myFile;

// change this to match your SD shield or module;
//     Arduino Ethernet shield: pin 4
//     Adafruit SD shields and modules: pin 10
//     Sparkfun SD shield: pin 8
const int chipSelect = 4;

float x = 0;
float y = 0;

void setup()
{
 // Open serial communications and wait for port to open:
  Serial.begin(9600);
   while (!Serial) {
    ; // wait for serial port to connect. Needed for Leonardo only
  }

  Serial.begin(9600);
  Serial.println("RA8875 start");

  /* Initialise the display using 'RA8875_480x272' or 'RA8875_800x480' */
  if (!tft.begin(RA8875_800x480)) {
    Serial.println("RA8875 Not Found!");
    while (1);
  }

  Serial.println("Found RA8875");

  tft.displayOn(true);
  tft.GPIOX(true);      // Enable TFT - display enable tied to GPIOX
  tft.PWM1config(true, RA8875_PWM_CLK_DIV1024); // PWM output for backlight
  tft.PWM1out(255);

  Serial.print("Initializing SD card...");
  // On the Ethernet Shield, CS is pin 4. It's set as an output by default.
  // Note that even if it's not used as the CS pin, the hardware SS pin 
  // (10 on most Arduino boards, 53 on the Mega) must be left as an output 
  // or the SD library functions will not work. 
   pinMode(SS, OUTPUT);
   
  if (!SD.begin(chipSelect)) {
    Serial.println("initialization failed!");
    return;
  }
  Serial.println("initialization done.");
  
  pinMode(RA8875_INT, INPUT);
  digitalWrite(RA8875_INT, HIGH);
  
  tft.touchEnable(true);
}

void loop()
{
  //open the file for reading:
  myFile = SD.open("x1.txt");
  if (myFile) {
    Serial.println("x1.txt:");
    
    // read from the file until there's nothing else in it:
    while (myFile.available()) {
    	x = (myFile.read());
    }
    // close the file:
    myFile.close();
  } else {
  	// if the file didn't open, print an error:
    Serial.println("error opening x1.txt");
  }
  myFile = SD.open("y1.txt");
  if (myFile) {
    Serial.println("y1.txt:");
    
    // read from the file until there's nothing else in it:
    while (myFile.available()) {
    	y = (myFile.read());
    }
    // close the file:
    myFile.close();
  } else {
  	// if the file didn't open, print an error:
    Serial.println("error opening y1.txt");
  }
  
  float xScale = 1024.0F/tft.width();
  float yScale = 1024.0F/tft.height();
  /* Wait around for touch events */
  if (! digitalRead(RA8875_INT)) 
  {
    if (tft.touched()) 
    {
      tft.touchRead(&tx, &ty);
      /* Draw a circle */
      tft.fillCircle((uint16_t)(tx/xScale), (uint16_t)(ty/yScale), 4, RA8875_WHITE);
    } 
  }
  
  Serial.println(x);
  Serial.println(y);
  
  tft.fillCircle(x, y, 4, RA8875_GREEN);
  delay (1000);
}

Another issue I am running into is the SD card and the screen frequently have problems when in the same sketch forcing me to unplug and reset the arduino to get them working again. It might be because they both use SPI but I am not sure.