<s> import time <EOL> import math <EOL> import mpu6050 <EOL> mpu = mpu6050 . MPU6050 ( ) <EOL> mpu . dmpInitialize ( ) <EOL> mpu . setDMPEnabled ( True ) <EOL> packetSize = mpu . dmpGetFIFOPacketSize ( ) <EOL> while True : <EOL> mpuIntStatus = mpu . getIntStatus ( ) <EOL> if mpuIntStatus >= <NUM_LIT:2> : <EOL> fifoCount = mpu . getFIFOCount ( ) <EOL> if fifoCount == <NUM_LIT> : <EOL> mpu . resetFIFO ( ) <EOL> print ( '<STR_LIT>' ) <EOL> fifoCount = mpu . getFIFOCount ( ) <EOL> while fifoCount < packetSize : <EOL> fifoCount = mpu . getFIFOCount ( ) <EOL> result = mpu . getFIFOBytes ( packetSize ) <EOL> q = mpu . dmpGetQuaternion ( result ) <EOL> g = mpu . dmpGetGravity ( q ) <EOL> ypr = mpu . dmpGetYawPitchRoll ( q , g ) <EOL> print ( ypr [ '<STR_LIT>' ] * <NUM_LIT> / math . pi ) , <EOL> print ( ypr [ '<STR_LIT>' ] * <NUM_LIT> / math . pi ) , <EOL> print ( ypr [ '<STR_LIT>' ] * <NUM_LIT> / math . pi ) <EOL> fifoCount -= packetSize </s>
