Trying to make LED light up based on MPU 5060 measurements

Hi! I am a newbie with arduino, and I am currently working on a project that uses MPU 5060 to measure the coordinates and make LEDs light up based on the tilting of the sensor.

So far I have used Jeff Rowberg and Luis Rodenas's code to measure and calibrate the data obtained from the MPU 5060 sensor. I wanted to attach 4 LED lights onto my breadboard and make them lit up whenever the sensor is tilted towards that direction (so left right up down or xy coordinates).

Can somebody give me any advice with coding this? I am not sure where to start...

mpu 5060 initial.doc (58.5 KB)

mpu 5060 calibration.doc (37.5 KB)

Do you mean a MPU6050 ?

yes. one arduino uno, one mpu 5060, and 4 led lights

It's going to be hard if you read and write code as carelessly as the posts in this forum...

Anyways. What have you done, what are your results so far?

Get the MPU6050 working, so you can read sensible output e.g. on the serial monitor.
Then start a new sketch and play around with switching LEDs.

Then combine the two.

I managed to use the two codes that I posted to get the MPU5060 running and get calibrated data. (IN xyzw coordinates)

The part I am confused is how to "connect" the data from the serial monitor and the LED lights. I am confused how to 1. only extract the xy coordinates from the serial monitor data 2. make the LED lights light up if there is a change in xy coordinates 3. selecting the appropriate keywords to google possible libraries or help I will need in general.

I am not so familiar with coding in general so it has been difficult to find resources that I can actually understand and follow

Well, post your code in code tags and we might be able to help.

Keywords for google? Well... C++ if, C++ comparison, Arduino LED

Look into the Arduino example "IfStatementConditional" and understand it.