Signed-off-by: myperworld <myperworld@126.com>
This commit is contained in:
1 parent
0986832fd1
commit
aacd052c06
3403 files changed
+597376
-12
No files matched your search
@@ -0,0 +1,22 @@
|
||||
|
||||
#include <MPU6050_tockn.h>
|
||||
#include <Wire.h>
|
||||
|
||||
MPU6050 mpu6050(Wire);
|
||||
|
||||
void setup() {
|
||||
Serial.begin(9600);
|
||||
Wire.begin();
|
||||
mpu6050.begin();
|
||||
mpu6050.calcGyroOffsets(true);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
mpu6050.update();
|
||||
Serial.print("angleX : ");
|
||||
Serial.print(mpu6050.getAngleX());
|
||||
Serial.print("\tangleY : ");
|
||||
Serial.print(mpu6050.getAngleY());
|
||||
Serial.print("\tangleZ : ");
|
||||
Serial.println(mpu6050.getAngleZ());
|
||||
}
|
||||
Reference in new issue
Block a user