void setup() {
Serial.begin(115200);
Wire.begin();
if (!mpu.begin()) {
Serial.println("Falha ao iniciar o sensor MPU6050");
while (1);
}
unsigned long currentMillis = millis();
// Verificar se é hora de enviar os dados
if (currentMillis - previousMillis >= interval) {
previousMillis = currentMillis;
// Ler os valores do sensor MPU6050
sensors_event_t a, g, temp;
mpu.getEvent(&a, &g, &temp);
accelerometerX = a.acceleration.x;
accelerometerY = a.acceleration.y;
accelerometerZ = a.acceleration.z;
gyroX = g.gyro.x;
gyroY = g.gyro.y;
gyroZ = g.gyro.z;
temperature = temp.temperature;
Adafruit_MPU6050 mpu; float accelerometerX, accelerometerY, accelerometerZ; float gyroX, gyroY, gyroZ; float temperature;
void setup() { Serial.begin(115200); Wire.begin(); if (!mpu.begin()) { Serial.println("Falha ao iniciar o sensor MPU6050"); while (1); }
unsigned long currentMillis = millis(); // Verificar se é hora de enviar os dados if (currentMillis - previousMillis >= interval) { previousMillis = currentMillis;