Help with calculating Pitch and Roll from MPU6050

Refer to @SpikeyGG post here for examples:

This is simply a motion/vibration sensor for washer and dryer. But the example is valuable because it shows how to define a global variable and then set the value of that global variable using a lambda. It also shows how to use the sensor values from the MPU6050 in your own calculation.