Skip to content

Commit 3e00ecf

Browse files
authored
Merge pull request #142 from Tinyu-Zhao/master
StickC Basic & README update
2 parents a6f243d + 898813b commit 3e00ecf

File tree

11 files changed

+225
-196
lines changed

11 files changed

+225
-196
lines changed

README.md

Lines changed: 8 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@
33
English | [中文](README_cn.md)
44

55
<img src="https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_content/core/m5stickc_01.png" alt="M5StickC_01" width="350" height="350">
6-
<img src="https://docs.m5stack.com/assets/img/product_pics/core/minicore/m5stickc/m5stickc_05.jpg" alt="M5StickC_01" height="350" style="margin-left:20px">
76

8-
* **For the Detailed documentation of M5StickC, please click [here](https://docs.m5stack.com/#/en/core/m5stickc)**
7+
* **For the Detailed documentation of M5StickC, please [Click here](https://docs.m5stack.com/#/en/core/m5stickc)**
98

10-
* **In order to buy M5StickC, please click [here](https://www.aliexpress.com/item/New-Arrival-2019-M5StickC-1-of-Limited-Trial-Edition-ESP32-PICO-Mini-IoT-Development-Board-Finger/32985247364.html)**
9+
* **In order to buy M5StickC, please [Click here](https://www.aliexpress.com/item/New-Arrival-2019-M5StickC-1-of-Limited-Trial-Edition-ESP32-PICO-Mini-IoT-Development-Board-Finger/32985247364.html)**
1110

1211

1312
## Description
@@ -16,50 +15,17 @@ English | [中文](README_cn.md)
1615

1716
**Switching machine operation:** Press for two seconds to turn it on, and press and hold for six seconds to turn it off.
1817

19-
## PinMap
18+
## More Information
2019

21-
**Red LED & IR transmitter & BUTTON A & BUTTON B**
20+
**UIFlow Quick Start**: Please [Click Here](https://docs.m5stack.com/en/quick_start/m5stickc/m5stickc_quick_start_with_uiflow)
2221

23-
<table>
24-
<tr><td>ESP32 chip</td><td>GPIO10</td><td>GPIO9</td><td>GPIO37</td><td>GPIO39</td></tr>
25-
<tr><td>Red LED</td><td>LED pin</td><td> </td><td> </td><td> </td></tr>
26-
<tr><td>IR transmitter</td><td> </td><td>transmitter pin</td><td> </td><td> </td></tr>
27-
<tr><td>BUTTON A</td><td> </td><td> </td><td>button pin</td><td> </td></tr>
28-
<tr><td>BUTTON B</td><td> </td><td> </td><td> </td><td>button pin</td></tr>
29-
</table>
22+
**MicroPyhton API**: Please [Click Here](https://docs.m5stack.com/en/mpy/display/m5stack_lvgl)
3023

31-
**TFT Screen**
24+
**Arduino IDE Development**: Please [Click Here](https://docs.m5stack.com/en/arduino/arduino_development)
3225

33-
*Driver IC: [ST7735S](https://github.com/m5stack/M5-Schematic/blob/master/Core/ST7735S_v1.1.pdf)*
26+
**M5StickC Arduino API**: Please [Click Here](https://docs.m5stack.com/en/api/stickc/system_m5stickc)
3427

35-
*Resolution: 80 * 160*
36-
37-
<table>
38-
<tr><td>ESP32 chip</td><td>GPIO15</td><td>GPIO13</td><td>GPIO23</td><td>GPIO18</td><td>GPIO5</td></tr>
39-
<tr><td>TFT Screen</td><td>TFT_MOSI</td><td>TFT_CLK</td><td>TFT_DC</td><td>TFT_RST</td><td>TFT_CS</td></tr>
40-
</table>
41-
42-
**GROVE interface**
43-
44-
<table>
45-
<tr><td>ESP32 chip</td><td>GPIO33</td><td>GPIO32</td><td>5V</td><td>GND</td></tr>
46-
<tr><td>GROVE interface</td><td>SCL</td><td>SDA</td><td>5V</td><td>GND</td></tr>
47-
</table>
48-
49-
**Microphone ([SPM1423](https://github.com/m5stack/M5-Schematic/blob/master/Core/SPM1423HM4H-B.pdf))**
50-
51-
<table>
52-
<tr><td>ESP32 chip</td><td>GPIO0</td><td>GPIO34</td></tr>
53-
<tr><td>Microphone</td><td>SCL</td><td>SDA</td></tr>
54-
</table>
55-
56-
**6-axis IMU ([SH200Q](https://github.com/m5stack/M5-Schematic/blob/master/Core/SH200Q.pdf)) & Power Mangement IC ([AXP192](https://github.com/m5stack/M5-Schematic/blob/master/Core/AXP192%20Datasheet%20v1.13_cn.pdf))**
57-
58-
<table>
59-
<tr><td>ESP32 chip</td><td>GPIO22</td><td>GPIO21</td>
60-
<tr><td>6-axis IMU (SH200Q)</td><td>SCL</td><td>SDA</td>
61-
<tr><td>Power Mangement IC (AXP192)</td><td>SCL</td><td>SDA</td>
62-
</table>
28+
**PinMap**: Please [Click Here](https://docs.m5stack.com/en/core/m5stickc)
6329

6430
**M5StickC top extended IO port**
6531

README_cn.md

Lines changed: 9 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -4,60 +4,27 @@
44

55
<img src="https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/m5-docs_content/core/m5stickc_01.png" alt="M5StickC_01" width="350" height="350">
66

7-
* **如果查看 M5StickC 的详细介绍文档,点击[这里](https://docs.m5stack.com/#/zh_CN/core/m5stickc)**
7+
* **如果查看 M5StickC 的详细介绍文档,[点击这里](https://docs.m5stack.com/#/zh_CN/core/m5stickc)**
88

9-
* **如果想要购买 M5StickC 的话,点击[这里](https://item.taobao.com/item.htm?spm=a1z10.3-c.w4002-1172588106.12.7807425e3JNPRr&id=588710395351)**
9+
* **如果想要购买 M5StickC 的话,[点击这里](https://item.taobao.com/item.htm?spm=a1z10.3-c.w4002-1172588106.12.7807425e3JNPRr&id=588710395351)**
1010

1111
## 描述
1212

1313
<mark>**M5StickC**</mark> 是一个包含 0.96 寸 **TFT 彩屏** (80 x 160 分辨率)、**红色** LED 灯、按键、**麦克风**、红外发射管、六轴姿态传感器 (SH200Q) 和 80mAH 的电池的小型 **ESP32 开发板**。M5StickC 内的 ESP32 模组 **[ESP32-Pico](https://github.com/m5stack/M5-Schematic/blob/master/Core/esp32-pico-d4_datasheet_cn.pdf)** 还内置了 4MB 的flash。如果 M5StickC 装配上表带底座和表带,你可以将它戴在手腕上。
1414

15-
**开关机操作**短按两秒开机,长按六秒关机。
15+
**开关机操作** 短按两秒开机,长按六秒关机。
1616

17-
## 管脚映射
17+
## 更多信息
1818

19-
**红色 LED & 红外发射管 IR & 按键 BUTTON A & 按键 BUTTON B**
19+
**UIFlow 快速上手**: [点击这里](https://docs.m5stack.com/zh_CN/quick_start/m5stickc/m5stickc_quick_start_with_uiflow)
2020

21-
<table>
22-
<tr><td>ESP32 芯片</td><td>GPIO10</td><td>GPIO9</td><td>GPIO37</td><td>GPIO39</td></tr>
23-
<tr><td>红色 LED</td><td>LED 管脚</td><td> </td><td> </td><td> </td></tr>
24-
<tr><td>红外发射管 IR</td><td> </td><td>发射管引脚</td><td> </td><td> </td></tr>
25-
<tr><td>按键 BUTTON A</td><td> </td><td> </td><td>按键管脚</td><td> </td></tr>
26-
<tr><td>按键 BUTTON B</td><td> </td><td> </td><td> </td><td>按键管脚</td></tr>
27-
</table>
21+
**MicroPyhton API**: [点击这里](https://docs.m5stack.com/zh_CN/mpy/display/m5stack_lvgl)
2822

29-
**TFT 屏幕**
23+
**Arduino IDE 环境搭建**: [点击这里](https://docs.m5stack.com/zh_CN/arduino/arduino_development)
3024

31-
*驱动芯片:[ST7735S](https://github.com/m5stack/M5-Schematic/blob/master/Core/ST7735S_v1.1.pdf)*
25+
**M5StickC Arduino API**: [点击这里](https://docs.m5stack.com/en/api/stickc/system_m5stickc)
3226

33-
*分辨率:80 * 160*
34-
35-
<table>
36-
<tr><td>ESP32 芯片</td><td>GPIO15</td><td>GPIO13</td><td>GPIO23</td><td>GPIO18</td><td>GPIO5</td></tr>
37-
<tr><td>TFT 屏幕</td><td>TFT_MOSI</td><td>TFT_CLK</td><td>TFT_DC</td><td>TFT_RST</td><td>TFT_CS</td></tr>
38-
</table>
39-
40-
**GROVE 接口**
41-
42-
<table>
43-
<tr><td>ESP32 芯片</td><td>GPIO33</td><td>GPIO32</td><td>5V</td><td>GND</td></tr>
44-
<tr><td>GROVE 接口</td><td>SCL</td><td>SDA</td><td>5V</td><td>GND</td></tr>
45-
</table>
46-
47-
**麦克风 MIC ([SPM1423](https://github.com/m5stack/M5-Schematic/blob/master/Core/SPM1423HM4H-B.pdf))**
48-
49-
<table>
50-
<tr><td>ESP32 芯片</td><td>GPIO0</td><td>GPIO34</td></tr>
51-
<tr><td>麦克风 MIC</td><td>SCL</td><td>SDA</td></tr>
52-
</table>
53-
54-
**六轴姿态传感器 ([SH200Q](https://github.com/m5stack/M5-Schematic/blob/master/Core/SH200Q.pdf)) & 电源管理芯片 ([AXP192](https://github.com/m5stack/M5-Schematic/blob/master/Core/AXP192%20Datasheet%20v1.13_cn.pdf))**
55-
56-
<table>
57-
<tr><td>ESP32 芯片</td><td>GPIO22</td><td>GPIO21</td>
58-
<tr><td>六轴姿态传感器</td><td>SCL</td><td>SDA</td>
59-
<tr><td>电源管理芯片</td><td>SCL</td><td>SDA</td>
60-
</table>
27+
**引脚地图**: [点击这里](https://docs.m5stack.com/zh_CN/core/m5stickc)
6128

6229
**M5StickC 顶部拓展的 IO 口**
6330

examples/Basics/AXP192/AXP192.ino

Lines changed: 49 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,58 @@
1+
/*
2+
*******************************************************************************
3+
* Copyright (c) 2021 by M5Stack
4+
* Equipped with M5StickC sample source code
5+
* 配套 M5StickC 示例源代码
6+
* Visit the website for more information:https://docs.m5stack.com/en/core/m5stickc
7+
* 获取更多资料请访问:https://docs.m5stack.com/zh_CN/core/m5stickc
8+
*
9+
* describe: APX192.
10+
* date:2021/9/3
11+
*******************************************************************************
12+
*/
113
#include <M5StickC.h>
214
#include "AXP192.h"
3-
TFT_eSprite tftSprite = TFT_eSprite(&M5.Lcd);
15+
#include <M5GFX.h>
16+
M5GFX display;
417

18+
/* After M5StickC is started or reset
19+
the program in the setUp () function will be run, and this part will only be run once.
20+
在 M5StickC 启动或者复位后,即会开始执行setup()函数中的程序,该部分只会执行一次。 */
521
void setup() {
6-
M5.begin();
7-
M5.Lcd.setRotation(3);
8-
tftSprite.createSprite(160, 80);
9-
tftSprite.setRotation(3);
10-
M5.Axp.EnableCoulombcounter();
22+
M5.begin();
23+
display.begin();
24+
display.setRotation(3);
25+
M5.Axp.EnableCoulombcounter(); //Enable Coulomb counter. 启用库仑计数器
1126
}
1227

28+
/* After the program in setup() runs, it runs the program in loop()
29+
The loop() function is an infinite loop in which the program runs repeatedly
30+
在setup()函数中的程序执行完后,会接着执行loop()函数中的程序
31+
loop()函数是一个死循环,其中的程序会不断的重复运行 */
1332
void loop() {
14-
tftSprite.fillSprite(BLACK);
15-
tftSprite.setCursor(0, 0, 1);
16-
tftSprite.printf("AXP Temp: %.1fC \r\n", M5.Axp.GetTempInAXP192());
17-
tftSprite.setCursor(0, 10);
18-
tftSprite.printf("Bat:\r\n V: %.3fv I: %.3fma\r\n", M5.Axp.GetBatVoltage(), M5.Axp.GetBatCurrent());
19-
tftSprite.setCursor(0, 30);
20-
tftSprite.printf("USB:\r\n V: %.3fv I: %.3fma\r\n", M5.Axp.GetVBusVoltage(), M5.Axp.GetVBusCurrent());
21-
tftSprite.setCursor(0, 50);
22-
tftSprite.printf("5V-In:\r\n V: %.3fv I: %.3fma\r\n", M5.Axp.GetVinVoltage(), M5.Axp.GetVinCurrent());
23-
tftSprite.setCursor(0, 70);
24-
tftSprite.printf("Bat power %.3fmw", M5.Axp.GetBatPower());
25-
tftSprite.pushSprite(0, 0);
33+
display.setCursor(0, 0, 1);
34+
display.printf("AXP Temp: %.1fC \r\n", M5.Axp.GetTempInAXP192());
35+
display.printf("Bat:\r\n V: %.3fv I: %.3fma\r\n", M5.Axp.GetBatVoltage(), M5.Axp.GetBatCurrent());
36+
display.printf("USB:\r\n V: %.3fv I: %.3fma\r\n", M5.Axp.GetVBusVoltage(), M5.Axp.GetVBusCurrent());
37+
display.printf("5V-In:\r\n V: %.3fv I: %.3fma\r\n", M5.Axp.GetVinVoltage(), M5.Axp.GetVinCurrent());
38+
display.printf("Bat power %.3fmw", M5.Axp.GetBatPower());
2639

27-
// 0x01 long press(1s), 0x02 press
28-
if(M5.Axp.GetBtnPress() == 0x02)
29-
{
30-
esp_restart();
31-
}
32-
33-
if(M5.BtnA.wasPressed())
34-
{
35-
// close tft voltage output
36-
M5.Axp.SetLDO2(false);
37-
// close tft lcd voltage output
38-
M5.Axp.SetLDO3(false);
39-
}
40-
41-
M5.Axp.SetChargeCurrent(CURRENT_100MA);
42-
43-
M5.update();
44-
delay(100);
40+
// 0x01 long press(1s), 0x02 press
41+
if(M5.Axp.GetBtnPress() == 0x02)
42+
{
43+
esp_restart();
44+
}
45+
46+
if(M5.BtnA.wasPressed())
47+
{
48+
// close tft voltage output. 关闭 tft 电压输出
49+
M5.Axp.SetLDO2(false);
50+
// close tft lcd voltage output 关闭tft lcd电压输出
51+
M5.Axp.SetLDO3(false);
52+
}
53+
54+
M5.Axp.SetChargeCurrent(CURRENT_100MA); //set charge current(Not recommend to set charge current > 100mA, since Battery is only 80mAh). 设置充电电流(不建议设置充电电流 > 100mA,因为电池只有 80mAh。)
55+
56+
M5.update();
57+
delay(100);
4558
}
Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
1+
/*
2+
*******************************************************************************
3+
* Copyright (c) 2021 by M5Stack
4+
* Equipped with M5StickC sample source code
5+
* 配套 M5StickC 示例源代码
6+
* Visit the website for more information:https://docs.m5stack.com/en/core/m5stickc
7+
* 获取更多资料请访问:https://docs.m5stack.com/zh_CN/core/m5stickc
8+
*
9+
* describe: Display.
10+
* date:2021/9/3
11+
*******************************************************************************
12+
*/
113
#include <M5StickC.h>
214

3-
// the setup routine runs once when M5StickC starts up
15+
/* After M5StickC is started or reset
16+
the program in the setUp () function will be run, and this part will only be run once.
17+
在 M5StickC 启动或者复位后,即会开始执行setup()函数中的程序,该部分只会执行一次。 */
418
void setup() {
5-
6-
// initialize the M5StickC object
719
M5.begin();
8-
920
// Lcd display
1021
M5.Lcd.fillScreen(WHITE);
1122
delay(500);
@@ -18,14 +29,14 @@ void setup() {
1829
M5.Lcd.fillScreen(BLACK);
1930
delay(500);
2031

21-
// text print
32+
// text print. 文字打印
2233
M5.Lcd.fillScreen(BLACK);
2334
M5.Lcd.setCursor(0, 10);
2435
M5.Lcd.setTextColor(WHITE);
2536
M5.Lcd.setTextSize(1);
2637
M5.Lcd.printf("Display Test!");
2738

28-
// draw graphic
39+
// draw graphic. 绘图🌹
2940
delay(1000);
3041
M5.Lcd.drawRect(15, 55, 50, 50, BLUE);
3142
delay(1000);
@@ -37,11 +48,11 @@ void setup() {
3748
delay(1000);
3849
}
3950

40-
// the loop routine runs over and over again forever
51+
/* After the program in setup() runs, it runs the program in loop()
52+
The loop() function is an infinite loop in which the program runs repeatedly
53+
在setup()函数中的程序执行完后,会接着执行loop()函数中的程序
54+
loop()函数是一个死循环,其中的程序会不断的重复运行 */
4155
void loop(){
42-
43-
//rand draw
56+
//rand draw
4457
M5.Lcd.fillTriangle(random(M5.Lcd.width()-1), random(M5.Lcd.height()-1), random(M5.Lcd.width()-1), random(M5.Lcd.height()-1), random(M5.Lcd.width()-1), random(M5.Lcd.height()-1), random(0xfffe));
45-
46-
//M5.update();
4758
}
Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,31 @@
1+
/*
2+
*******************************************************************************
3+
* Copyright (c) 2021 by M5Stack
4+
* Equipped with M5StickC sample source code
5+
* 配套 M5StickC 示例源代码
6+
* Visit the website for more information:https://docs.m5stack.com/en/core/m5stickc
7+
* 获取更多资料请访问:https://docs.m5stack.com/zh_CN/core/m5stickc
8+
*
9+
* describe: Display.
10+
* date:2021/9/3
11+
*******************************************************************************
12+
*/
113
#include <M5StickC.h>
214

3-
// the setup routine runs once when M5StickC starts up
15+
/* After M5StickC is started or reset
16+
the program in the setUp () function will be run, and this part will only be run once.
17+
在 M5StickC 启动或者复位后,即会开始执行setup()函数中的程序,该部分只会执行一次。 */
418
void setup(){
5-
// Initialize the M5StickC object
19+
// Initialize the M5StickC object. 初始化 M5StickC 对象
620
M5.begin();
721

8-
// LCD display
22+
// LCD display. LCd显示
923
M5.Lcd.print("Hello World");
1024
}
1125

12-
// the loop routine runs over and over again forever
26+
/* After the program in setup() runs, it runs the program in loop()
27+
The loop() function is an infinite loop in which the program runs repeatedly
28+
在setup()函数中的程序执行完后,会接着执行loop()函数中的程序
29+
loop()函数是一个死循环,其中的程序会不断的重复运行 */
1330
void loop() {
14-
}
31+
}

0 commit comments

Comments
 (0)