MQTT통신1 [Python] MQTT를 이용한 자이로센서 값 전송 (raspberry pi 이용) (들어가기전에-> 1. 자이로센서는 MPU6050 사용하였습니다 ) (한국인이 좋아하는 결론부터 말하기) 자이로센서 값(데이터)를 전송하는 코드. ''' Read Gyro and Accelerometer by Interfacing Raspberry Pi with MPU6050 using Python http://www.electronicwings.com ''' import smbus #import SMBus module of I2C from time import sleep #some MPU6050 Registers and their Address PWR_MGMT_1 = 0x6B SMPLRT_DIV = 0x19 CONFIG = 0x1A GYRO_CONFIG = 0x1B INT_ENABLE = 0x38 AC.. 2022. 8. 15. 이전 1 다음