mirror of
https://github.com/m5stack/m5-docs.git
synced 2026-05-20 10:23:01 -07:00
update decription
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 231 KiB |
@@ -45,6 +45,8 @@ Supported development platforms and program languages: Arduino, Blockly language
|
||||
- SDIO master/salve 50MHz
|
||||
- SD-card interface support
|
||||
|
||||
<!--
|
||||
|
||||
## EasyLoader
|
||||
|
||||
<img src="https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/EasyLoader_logo.png" width="100px" style="margin-top:20px">
|
||||
@@ -55,6 +57,8 @@ Supported development platforms and program languages: Arduino, Blockly language
|
||||
|
||||
>2. After downloading the software, double-click to run the application, connect the M5 device to the computer through the data cable, select the port parameters, click **"Burn"** to start burning. (**For Atom burning, please Set the baud rate to 750000 or 115200**)
|
||||
|
||||
-->
|
||||
|
||||
<img src="assets/img/product_pics/core/minicore/atom/atom_lite_05.webp" width="30%" height="30%">
|
||||
|
||||
## Peripherals Pin Map
|
||||
|
||||
@@ -42,6 +42,7 @@ Supported development platforms and program languages: Arduino, Block based prog
|
||||
- SDIO master/salve 50MHz
|
||||
- SD-card interface support
|
||||
|
||||
<!--
|
||||
|
||||
## EasyLoader
|
||||
|
||||
@@ -53,6 +54,8 @@ Supported development platforms and program languages: Arduino, Block based prog
|
||||
|
||||
>2. After downloading the software, double-click to run the application, connect the M5 device to the computer through the data cable, select the port parameters, click **"Burn"** to start burning. (**For Atom burning, please Set the baud rate to 750000 or 115200**)
|
||||
|
||||
-->
|
||||
|
||||
## Peripherals Pin Map
|
||||
|
||||
<img src="assets/img/product_pics/core/minicore/atom/atom_matrix_04.webp" width="40%" height="40%">
|
||||
|
||||
+76
-1
@@ -25,4 +25,79 @@ More IO pins are extended, you can used DuPont Cable to connect other hardware.
|
||||
|
||||
## Include
|
||||
|
||||
- 1x M5:bit
|
||||
- 1x M5:bit
|
||||
|
||||
## Example
|
||||
|
||||
- **MakeCode**
|
||||
|
||||
<img src="assets/img/product_pics/unit/m5bit/m5bit.png">
|
||||
|
||||
### Arduino IDE
|
||||
|
||||
*The code below is incomplete. TO get complete code, please click [here](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Unit/M5Bit/Arduino/M5BIT).*
|
||||
|
||||
```arduino
|
||||
/*
|
||||
Connect to GRVOE C on M5Core
|
||||
*/
|
||||
#include <M5Stack.h>
|
||||
#include <M5StackUpdater.h>
|
||||
|
||||
#define WIDTH 320
|
||||
#define HEIGHT 240
|
||||
#define BLOCK_SIZE 40
|
||||
#define UNIT_WIDTH 5
|
||||
#define UNIT_HEIGHT 5
|
||||
#define UNIT_SIZE 25
|
||||
#define GETX(i) ((i) % (5))
|
||||
#define GETY(i) ((i) / (5))
|
||||
int world[UNIT_SIZE];
|
||||
int i;
|
||||
|
||||
void setup() {
|
||||
M5.begin();
|
||||
Wire.begin();
|
||||
if(digitalRead(BUTTON_A_PIN) == 0){
|
||||
Serial.println("Will load menu binary");
|
||||
updateFromFS(SD);
|
||||
ESP.restart();
|
||||
}
|
||||
Serial2.begin(115200, SERIAL_8N1, 16, 17);
|
||||
M5.Lcd.fillScreen(BLACK);
|
||||
M5.Lcd.setTextSize(2);
|
||||
M5.Lcd.setCursor(35, 220);
|
||||
M5.Lcd.println(" < * >");
|
||||
for (i = 0; i < UNIT_SIZE; i++) {
|
||||
world[i] = 0;
|
||||
}
|
||||
i = UNIT_SIZE / 2;
|
||||
}
|
||||
|
||||
void loop() {
|
||||
M5.update();
|
||||
int x = GETX(i) + 1;
|
||||
int y = GETY(i);
|
||||
if (world[i] > 0) M5.Lcd.fillRect(x * BLOCK_SIZE + 1, y * BLOCK_SIZE + 1, BLOCK_SIZE - 2, BLOCK_SIZE - 2, LIGHTGREY);
|
||||
else M5.Lcd.fillRect(x * BLOCK_SIZE + 1, y * BLOCK_SIZE + 1, BLOCK_SIZE - 2, BLOCK_SIZE - 2, BLUE);
|
||||
if (M5.BtnC.wasPressed()) {
|
||||
if (world[i] > 0) M5.Lcd.fillRect(x * BLOCK_SIZE + 1, y * BLOCK_SIZE + 1, BLOCK_SIZE - 2, BLOCK_SIZE - 2, WHITE);
|
||||
else M5.Lcd.fillRect(x * BLOCK_SIZE, y * BLOCK_SIZE, BLOCK_SIZE, BLOCK_SIZE, BLACK);
|
||||
++i;
|
||||
if (i >= UNIT_SIZE) i=0;
|
||||
}
|
||||
if (M5.BtnA.wasPressed()) {
|
||||
if (world[i] > 0) M5.Lcd.fillRect(x * BLOCK_SIZE + 1, y * BLOCK_SIZE + 1, BLOCK_SIZE - 2, BLOCK_SIZE - 2, WHITE);
|
||||
else M5.Lcd.fillRect(x * BLOCK_SIZE, y * BLOCK_SIZE, BLOCK_SIZE, BLOCK_SIZE, BLACK);
|
||||
--i;
|
||||
if (i < 0 ) i=UNIT_SIZE -1;
|
||||
}
|
||||
if (M5.BtnB.wasPressed()) {
|
||||
if (world[i] > 0) world[i]=0;
|
||||
else world[i]=1;
|
||||
Serial2.print(world[i]);
|
||||
Serial2.print(GETX(i));
|
||||
Serial2.println(GETY(i));
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
@@ -41,6 +41,8 @@
|
||||
- SDIO master/salve 50MHz
|
||||
- 支持SD卡接口
|
||||
|
||||
<!--
|
||||
|
||||
## EasyLoader
|
||||
|
||||
<img src="https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/EasyLoader_logo.png" width="100px" style="margin-top:20px">
|
||||
@@ -51,6 +53,8 @@
|
||||
|
||||
>2.下载软件后,双击运行应用程序,将M5设备通过数据线连接至电脑,选择端口参数,点击 **"Burn"** 即可开始烧录.(**为Atom烧录时,请将波特率设置在750000或115200**)
|
||||
|
||||
-->
|
||||
|
||||
## 外设的管脚映射
|
||||
|
||||
<table>
|
||||
|
||||
@@ -43,6 +43,8 @@
|
||||
- SDIO master/salve 50MHz
|
||||
- 支持SD卡接口
|
||||
|
||||
<!--
|
||||
|
||||
## EasyLoader
|
||||
|
||||
<img src="https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/EasyLoader_logo.png" width="100px" style="margin-top:20px">
|
||||
@@ -53,6 +55,7 @@
|
||||
|
||||
>2.下载软件后,双击运行应用程序,将M5设备通过数据线连接至电脑,选择端口参数,点击 **"Burn"** 即可开始烧录.(**为Atom烧录时,请将波特率设置在750000或115200**)
|
||||
|
||||
-->
|
||||
|
||||
## 外设的管脚映射
|
||||
|
||||
|
||||
@@ -28,3 +28,80 @@
|
||||
## 套件清单
|
||||
|
||||
- 1x M5:bit
|
||||
|
||||
## 例程
|
||||
|
||||
- **MakeCode**
|
||||
|
||||
<img src="assets/img/product_pics/unit/m5bit/m5bit.png">
|
||||
|
||||
### Arduino IDE
|
||||
|
||||
*以下代码仅为片段,如需获取完整代码, [请点击此处](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Unit/M5Bit/Arduino/M5BIT).*
|
||||
|
||||
```arduino
|
||||
/*
|
||||
Connect to GRVOE C on M5Core
|
||||
*/
|
||||
#include <M5Stack.h>
|
||||
#include <M5StackUpdater.h>
|
||||
|
||||
#define WIDTH 320
|
||||
#define HEIGHT 240
|
||||
#define BLOCK_SIZE 40
|
||||
#define UNIT_WIDTH 5
|
||||
#define UNIT_HEIGHT 5
|
||||
#define UNIT_SIZE 25
|
||||
#define GETX(i) ((i) % (5))
|
||||
#define GETY(i) ((i) / (5))
|
||||
int world[UNIT_SIZE];
|
||||
int i;
|
||||
|
||||
void setup() {
|
||||
M5.begin();
|
||||
Wire.begin();
|
||||
if(digitalRead(BUTTON_A_PIN) == 0){
|
||||
Serial.println("Will load menu binary");
|
||||
updateFromFS(SD);
|
||||
ESP.restart();
|
||||
}
|
||||
Serial2.begin(115200, SERIAL_8N1, 16, 17);
|
||||
M5.Lcd.fillScreen(BLACK);
|
||||
M5.Lcd.setTextSize(2);
|
||||
M5.Lcd.setCursor(35, 220);
|
||||
M5.Lcd.println(" < * >");
|
||||
for (i = 0; i < UNIT_SIZE; i++) {
|
||||
world[i] = 0;
|
||||
}
|
||||
i = UNIT_SIZE / 2;
|
||||
}
|
||||
|
||||
void loop() {
|
||||
M5.update();
|
||||
int x = GETX(i) + 1;
|
||||
int y = GETY(i);
|
||||
if (world[i] > 0) M5.Lcd.fillRect(x * BLOCK_SIZE + 1, y * BLOCK_SIZE + 1, BLOCK_SIZE - 2, BLOCK_SIZE - 2, LIGHTGREY);
|
||||
else M5.Lcd.fillRect(x * BLOCK_SIZE + 1, y * BLOCK_SIZE + 1, BLOCK_SIZE - 2, BLOCK_SIZE - 2, BLUE);
|
||||
if (M5.BtnC.wasPressed()) {
|
||||
if (world[i] > 0) M5.Lcd.fillRect(x * BLOCK_SIZE + 1, y * BLOCK_SIZE + 1, BLOCK_SIZE - 2, BLOCK_SIZE - 2, WHITE);
|
||||
else M5.Lcd.fillRect(x * BLOCK_SIZE, y * BLOCK_SIZE, BLOCK_SIZE, BLOCK_SIZE, BLACK);
|
||||
++i;
|
||||
if (i >= UNIT_SIZE) i=0;
|
||||
}
|
||||
if (M5.BtnA.wasPressed()) {
|
||||
if (world[i] > 0) M5.Lcd.fillRect(x * BLOCK_SIZE + 1, y * BLOCK_SIZE + 1, BLOCK_SIZE - 2, BLOCK_SIZE - 2, WHITE);
|
||||
else M5.Lcd.fillRect(x * BLOCK_SIZE, y * BLOCK_SIZE, BLOCK_SIZE, BLOCK_SIZE, BLACK);
|
||||
--i;
|
||||
if (i < 0 ) i=UNIT_SIZE -1;
|
||||
}
|
||||
if (M5.BtnB.wasPressed()) {
|
||||
if (world[i] > 0) world[i]=0;
|
||||
else world[i]=1;
|
||||
Serial2.print(world[i]);
|
||||
Serial2.print(GETX(i));
|
||||
Serial2.println(GETY(i));
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user