-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathz_testLog.ino
34 lines (27 loc) · 896 Bytes
/
z_testLog.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//test functions for logging and debugging
//in setup() -> use while(!Serial){...} to print to serial monitor
//this is necessary because Leonardo has only 1 chip for USB communication and processing of sketches
//prints state of MPU6050 (asleep or active) to serial monitor
void printSleepModeStatus(){
if(mpu.getSleepEnabled()){
Serial.println("MPU is asleep");
}else{
Serial.println("MPU is active");
}
}
//prints I2C connection status of MPU6050 to serial monitor
void printConnectionStatus(){
if(mpu.testConnection()){
Serial.println("MPU I2C connection established");
}else{
Serial.println("MPU I2C connection could not be established");
}
}
//prints gyroscope data for x- and y-axis to serial monitor
void printGyroData(){
Serial.print(" | GyroX: ");
Serial.print(gyroX);
Serial.print(" | GyroY: ");
Serial.print(gyroY);
delay(200);
}