MPU6050-ESP8266-MicroPython
具有micropython的ESP8266上MPU6050的简单库
SCL连接到引脚5,SDA连接到引脚4的用法示例:
>> > from machine import I2C , Pin
>> > import mpu6050
>> > i2c = I2C ( scl = Pin ( 5 ), sda = Pin ( 4 ))
>> > accelerometer = mpu6050 . accel ( i2c )
>> > accelerometer . get_values ()
{ 'GyZ' : - 235 , 'GyY' : 296 , 'GyX' : 16 , 'Tmp' : 26.64764 , 'AcZ' : - 1552 , 'AcY' : - 412 , 'AcX' : 16892 }
加速度计/陀螺仪的
2021-08-20 08:06:53
1KB
Python
1