feat: 全量同步 254 个常用的 Arduino 扩展库文件

This commit is contained in:
yczpf2019
2026-01-24 16:05:38 +08:00
parent c665ba662b
commit 397b9a23a3
6878 changed files with 2732224 additions and 1 deletions

View File

@@ -0,0 +1,42 @@
#include <M5StickCPlus.h>
float accX = 0;
float accY = 0;
float accZ = 0;
float gyroX = 0;
float gyroY = 0;
float gyroZ = 0;
float temp = 0;
void setup() {
// put your setup code here, to run once:
M5.begin();
M5.Lcd.setRotation(3);
M5.Lcd.fillScreen(BLACK);
M5.Lcd.setTextSize(1);
M5.Lcd.setCursor(50, 15);
M5.Lcd.println("MPU6886 TEST");
M5.Lcd.setCursor(30, 30);
M5.Lcd.println(" X Y Z");
M5.Imu.Init();
}
void loop() {
// put your main code here, to run repeatedly:
M5.Imu.getGyroData(&gyroX,&gyroY,&gyroZ);
M5.Imu.getAccelData(&accX,&accY,&accZ);
M5.Imu.getTempData(&temp);
M5.Lcd.setCursor(30, 45);
M5.Lcd.printf("%.2f %.2f %.2f ", gyroX, gyroY,gyroZ);
M5.Lcd.setCursor(170, 45);
M5.Lcd.print("o/s");
M5.Lcd.setCursor(30, 60);
M5.Lcd.printf("%.2f %.2f %.2f ",accX * 1000,accY * 1000, accZ * 1000);
M5.Lcd.setCursor(185, 60);
M5.Lcd.print("mg");
M5.Lcd.setCursor(30, 75);
M5.Lcd.printf("Temperature : %.2f C", temp);
delay(100);
}