from machine import Pin, I2C,sleep
import MPU6050, time

pin_sc1 = 22
pin_sda = 21

i2c = I2C(0, scl=Pin(pin_sc1), sda=Pin(pin_sda))
print(i2c.scan()) #scan for devices

ledf = Pin(13, Pin.OUT)


# set up the IMPU6050 class
mpu= MPU6050.MPU6050(i2c)

# wake up the MPU6050 from sleep
mpu.wake()

# continuously print the data
while True:
    gyro = mpu.read_gyro_data()
    print("Gyro: "+""+ str(gyro))
    time.sleep(0.1)

    if gyro > 10:
        ledf.value(1)
        time.sleep(3)
        ledf.value(0)