122
//
kutubxonalarni ulash
#include “I2Cdev.h”
#include “MPU6050.h”
#include “Wire.h”
MPU6050 accelgyro;
int16_t ax, ay, az;
int16_t gx, gy, gz;
void setup()
{
}
Wire.begin();
Serial.begin(38400);
//
boshlash
Serial.println(“Initializing I2C devices...”);
accelgyro.initialize();
delay(100);
}
void loop()
{
// gyroskop va akselerometr qiymatlarini o’qish
accelgyro.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);
// monitorga
qiymatlarni chiqarish
Do'stlaringiz bilan baham: