Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Tinyu-Zhao committed Aug 20, 2021
1 parent f131b96 commit c4b27c3
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 18 deletions.
6 changes: 0 additions & 6 deletions examples/.vscode/settings.json

This file was deleted.

6 changes: 3 additions & 3 deletions examples/Basics/mpu6886/mpu6886.ino
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ void loop() {
M5.IMU.getAhrsData(&pitch,&roll,&yaw); //Stores the inertial sensor attitude. 存储惯性传感器的姿态
M5.IMU.getTempData(&temp); //Stores the inertial sensor temperature to temp. 存储惯性传感器的温度
/* The M5Core screen is 320x240 pixels, starting at the top left corner of the screen (0,0).
gyroscope output related
M5Stack屏幕像素为 320x240,以屏幕左上角为原点 (0,0)*/
gyroscope output related
M5Core2屏幕像素为 320x240,以屏幕左上角为原点 (0,0)*/
//gyroscope output related. 陀螺仪输出相关
M5.Lcd.setCursor(0, 20); //Move the cursor position to (x,y). 移动光标位置到(x,y)处
M5.Lcd.printf("gyroX, gyroY, gyroZ"); //Screen printingformatted string. 输出格式化字符串
Expand All @@ -72,5 +72,5 @@ M5Stack屏幕像素为 320x240,以屏幕左上角为原点 (0,0)*/
M5.Lcd.setCursor(0, 175);
M5.Lcd.printf("Temperature : %.2f C", temp);

delay(10); // Delay 1000ms (1 sec) //延迟1000ms(1秒)
delay(10); // Delay 10ms. 延迟10ms
}
15 changes: 7 additions & 8 deletions examples/Unit/FAN/FAN.ino
Original file line number Diff line number Diff line change
@@ -1,30 +1,29 @@
/*
*******************************************************************************
* Copyright (c) 2021 by M5Stack
* Equipped with M5Core sample source code
* 配套 M5Core 示例源代码
* Visit the website for more information:https://docs.m5stack.com/en/core/gray
* 获取更多资料请访问:https://docs.m5stack.com/zh_CN/core/gray
* Equipped with M5Core2 sample source code
* 配套 M5Core2 示例源代码
* Visit the website for more information:https://docs.m5stack.com/en/core/core2
* 获取更多资料请访问:https://docs.m5stack.com/zh_CN/core/core2
*
* describe:Fan. 风扇
* date:2021/8/16
*******************************************************************************
Please connect to Port B(26), Adjust the speed of FAN Unit through PWM.
请连接端口B(26),通过PWM调节风扇单元的转速。
*/
#include <M5Stack.h>
#include <M5Core2.h>

#define motor_pin 26

int freq = 10000;
int ledChannel = 0;
int resolution = 10;
void setup() {
M5.begin(); //Init M5Stack. 初始化M5Stack
M5.Power.begin(); //Init power 初始化电源模块
M5.begin(); //Init M5Core2. 初始化M5Core2
M5.lcd.setTextSize(2); //Set the text size to 2. 设置文字大小为2
M5.Lcd.setCursor(80, 10); //Set the cursor at (80,10). 将光标设置在(80,10)处
M5.Lcd.println("MOTOR");
M5.Lcd.println("Fan");
ledcSetup(ledChannel, freq, resolution); //Sets the frequency and number of counts corresponding to the channel. 设置通道对应的频率和计数位数
ledcAttachPin(motor_pin, ledChannel); //Binds the specified channel to the specified I/O port for output. 将指定通道绑定到指定 IO 口上以实现输出
}
Expand Down
2 changes: 1 addition & 1 deletion examples/Unit/VIBRATOR/VIBRATOR.ino
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ int resolution = 10;
void setup() {
M5.begin(); //Init M5Core2. 初始化M5Core2
M5.lcd.setTextSize(2); //Set the text size to 2. 设置文字大小为2
M5.Lcd.setCursor(110, 10); //Set the cursor at (140,10). 将光标设置在(140,10)处
M5.Lcd.setCursor(110, 10); //Set the cursor at (110,10). 将光标设置在(110,10)处
M5.Lcd.println("Vibrator");
ledcSetup(ledChannel, freq, resolution); //Sets the frequency and number of counts corresponding to the channel. 设置通道对应的频率和计数位数
ledcAttachPin(motor_pin, ledChannel); //Binds the specified channel to the specified I/O port for output. 将指定通道绑定到指定 IO 口上以实现输出
Expand Down

0 comments on commit c4b27c3

Please sign in to comment.