lcd shield v1.1 with mpu6050 to display tilt

I am trying to use a mpu6050 accelerometer with a lcd shield v1.1 and an uno to display tilt. The accelerometer is wired into the shield like so;

Vcc - 5v
Gnd - gnd
SCL - A5
SDA - A4
INT - d7

(diagram of the shield)

I found the code I need for an uno to record the x y and z values of the tilt and I am trying to figure out how to run this code in the backround for the accelerometer, and display the values on the lcd. The code I am trying to use for the accelereometer is

#include <Wire.h>

long gyroX, gyroY, gyroZ;
float rotX, rotY, rotZ;

void setup() {

void loop() {

void setupMPU(){
Wire.beginTransmission(0b1101000); //This is the I2C address of the MPU (b1101000/b1101001 for AC0 low/high datasheet sec. 9.2)
Wire.write(0x6B); //Accessing the register 6B - Power Management (Sec. 4.28)
Wire.write(0b00000000); //Setting SLEEP register to 0. (Required; see Note on p. 9)
Wire.beginTransmission(0b1101000); //I2C address of the MPU
Wire.write(0x1B); //Accessing the register 1B - Gyroscope Configuration (Sec. 4.4)
Wire.write(0x00000000); //Setting the gyro to full scale +/- 250deg./s
Wire.beginTransmission(0b1101000); //I2C address of the MPU
Wire.write(0x1C); //Accessing the register 1C - Acccelerometer Configuration (Sec. 4.5)
Wire.write(0b00000000); //Setting the accel to +/- 2g

void recordGyroRegisters() {
Wire.beginTransmission(0b1101000); //I2C address of the MPU
Wire.write(0x43); //Starting register for Gyro Readings
Wire.requestFrom(0b1101000,6); //Request Gyro Registers (43 - 48)
while(Wire.available() < 6);
gyroX =<<8|; //Store first two bytes into accelX
gyroY =<<8|; //Store middle two bytes into accelY
gyroZ =<<8|; //Store last two bytes into accelZ

void processGyroData() {
rotX = gyroX / 131.0;
rotY = gyroY / 131.0;
rotZ = gyroZ / 131.0;

This sketch is verified, but obviously the shield isn’t going to magically know to display these values. My initial thought as to how I’m going to display these values is doing this

#include <LiquidCrystal.h>

#include “name of the file for the sketch above”

LiquidCrystal lcd(8, 9, 4, 5, 6, 7); // select the pins used on the LCD panel

void setup() {
lcd.begin(16, 2); // start the library

if (millis() - tepTimer > 500) { // output a value per 500ms
tepTimer = millis();

lcd.setCursor(0, 0);

// print the results to the lcd

Lcd.setCursor(0, 1);



Would something like this work? I tried to use the “#include” command for the sketch that calculates the tilt values to calculate these values in the background so that the loop function can display the values on the LCD. This is my first attempt ever at coding anything so some help would be great.

Please learn to use Code Tags </> for posting code.

I suspect this is wrong:

 while(Wire.available() < 6);

Okay thanks for the response! (sorry I'm not very experienced with arduino asking this complex of a question)