This commit is contained in:
LiHuashen
2019-04-09 15:45:55 +08:00
parent 5e7a689d96
commit aa00289657
4 changed files with 161 additions and 71 deletions
@@ -1,7 +1,5 @@
# M5Core Quick Start - Arduino Win {docsify-ignore-all}
<!-- ?> We suggest you confirm whether the `USB driver`, `Git` and `Arduino IDE` has installed first. If not, please view this two articles [establish serial connection](/en/related_documents/establish_serial_connection) and [Install Git and Arduino IDE](/en/related_documents/how_to_install_git_and_arduino). -->
## Table of Contents
**[1. Install Arduino IDE](#_1-install-Arduino-IDE)**
@@ -8,73 +8,129 @@
<img src="assets/img/getting_started_pics/m5stick/stick_01.png"><img src="assets/img/getting_started_pics/m5stick/stick_06.png"><img src="assets/img/macos-logo.png">
## Text Tutorial
## Table of Contents
1. [Setting Environment](#setting-environment)
**[1. Install Arduino IDE](#_1-install-Arduino-IDE)**
- [Step1. Install Arduino IDE](#step1-install-arduino-ide)
**[2. Install USB to Serial Driver](#_2-Install-USB-to-Serial-Driver)**
- [Step2. ESP32 Board Support](#step2-esp32-board-support)
**[3. Install ESP32 Boards Manager](#_3-Install-ESP32-Boards-Manager)**
- [Step3. Install M5Stack Lib](#step3-install-m5stack-lib)
**[4. Install M5Stack Library](#_4-Install-M5Stack-Library)**
- [Step4. Install U8g2 library](#Step4-Install-U8g2-library)
**[5. Install U8g2 Library](#_5-Install-U8g2-Library)**
2. [Example](#example)
**[6. Example](#_6-Example)**
## Setting Environment
## 1. Install Arduino IDE
### Step1. Install `Arduino IDE`
<!-- *注意:如果已经安装了 IDE,请直接从[步骤 2](#_2-安装串口驱动) 开始。* -->
First, if Arudino IDE is not installed, install it. It's *download address* is https://www.arduino.cc/en/Main/Software
Open your browser, enter the official website of Arduino https://www.arduino.cc/en/Main/Software
#### (1) click `Mac OS X` for downloading `Arduino IDE`
<img src="assets/img/getting_started_pics/m5stack_core/get_started_with_arduino_m5core/mac/macOS_download_arduino_ide.png">
### Step2. ESP32 Board Support
#### (2) click `JUST DOWNLOAD`
Open Arduino IDE, click `Arduino`->`Peferences`->`Settings`
<img src="assets/img/getting_started_pics/m5stack_core/get_started_with_arduino_m5core/mac/macOS_download_arduino_ide_02.png">
#### (3) Once the Arduino IDE is downloaded, you can double-click it to open it
<img src="assets/img/getting_started_pics/m5stack_core/get_started_with_arduino_m5core/mac/macOS_download_arduino_ide_03.png">
## 2. Install USB to Serial Driver
Open your browser, enter the official website of M5Stack https://m5stack.com/download
#### (1) click `Mac` for downloading this installation package and then unzip this package
<img src="assets/img/getting_started_pics/m5stack_core/get_started_with_arduino_m5core/mac/download_usb_driver_mac_01.png">
#### (2) After unzipped this package, double click the disk image `SiLabsUSBDriverDisk.dmg` for installing
<img src="assets/img/getting_started_pics/establish_serial_connection/macOS_CP2104_dmg.png">
<img src="assets/img/getting_started_pics/establish_serial_connection/macOS_CP2104_pkg.png">
<img src="assets/img/getting_started_pics/establish_serial_connection/2.png">
<img src="assets/img/getting_started_pics/establish_serial_connection/3.png">
<img src="assets/img/getting_started_pics/establish_serial_connection/4.png">
<img src="assets/img/getting_started_pics/establish_serial_connection/5.png">
<img src="assets/img/getting_started_pics/establish_serial_connection/6.png">
<img src="assets/img/getting_started_pics/establish_serial_connection/7.png">
<img src="assets/img/getting_started_pics/establish_serial_connection/8.png">
<img src="assets/img/getting_started_pics/establish_serial_connection/9.png">
#### (3) Check the serial port number `/dev/tty.SLAB_USBtoUART`
Comfirm if the USB to Serial Driver was successfully installed already:
Open `Terminal`, connect `M5Core` with PC through USB Type-C cable, and execute the following command for viewing serial port list.
<img src="assets/img/getting_started_pics/m5stack_core/get_started_with_arduino_m5core/mac/check_serial_port_mac_01.png">
<img src="assets/img/getting_started_pics/m5stack_core/get_started_with_arduino_m5core/mac/check_serial_port_mac_02.png">
Disconnect M5Core device, and execute the just executed command to verify which port disappears from the list. The disappearing COM port is the serial port name corresponding to M5Core.
<img src="assets/img/getting_started_pics/m5stack_core/get_started_with_arduino_m5core/mac/check_serial_port_mac_03.png">
Now, the serial port name is `tty.SLAB_USBtoUART`
## 3. Install ESP32 Boards Manager
#### (1) Open IDE, click `File`->`Peferences`->`Settings`
<img src="assets/img/getting_started_pics/m5stack_core/get_started_with_arduino_m5core/mac/quick_start_arduino_mac_01.png">
<img src="assets/img/getting_started_pics/m5stack_core/get_started_with_arduino_m5core/mac/quick_start_arduino_mac_02.png">
Copy the following last ESP32 Board Manager URL to this option `Additional Boards Manager URLs: `
#### (2) Copy the following ESP32 Boards Manager url to `Additional Boards Manager URLs:`
*NOW, last ESP32 board manager URL is https://dl.espressif.com/dl/package_esp32_index.json*
*ESP32 Boards Manager url: https://dl.espressif.com/dl/package_esp32_index.json*
<img src="assets/img/getting_started_pics/m5stack_core/get_started_with_arduino_m5core/mac/quick_start_arduino_mac_03.png">
Confirm OK and click `Tools`->`Board:`->`Boards Manager...` for installing esp32
Search `ESP32` in the new pop-up dialog, then click `install`
#### (3) Click `Tools`->`Board:`->`Boards Manager...`
<img src="assets/img/getting_started_pics/m5stack_core/get_started_with_arduino_m5core/mac/quick_start_arduino_mac_04.png">
#### (4) Search `ESP32` in the new pop-up dialog, then click `Install`
<img src="assets/img/getting_started_pics/m5stack_core/get_started_with_arduino_m5core/mac/quick_start_arduino_mac_05.png">
### Step3. Install M5Stack Lib
## 4. Install M5Stack Library
Start up Arduino IDE, then Select `Sketch`->`Include Library`->`Manage Libraries...`
#### (1) Open Arduino IDE, then Select `Sketch`->`Include Library`->`Manage Libraries...`
Type `M5Stack` into the search box, search it and install.
<img src="assets/img/getting_started_pics/m5stack_core/get_started_with_arduino_m5core/windows/install_m5stack_lib_01.png">
<img src="assets/img/getting_started_pics/m5stack_core/get_started_with_arduino_m5core/windows/quick_start_arduino_win_06.png">
#### (2) Search `M5Stack` and install it
<img src="assets/img/getting_started_pics/m5stack_core/get_started_with_arduino_m5core/windows/quick_start_arduino_win_07.png">
<img src="assets/img/getting_started_pics/m5stack_core/get_started_with_arduino_m5core/windows/install_m5stack_lib_02.png">
### Step4. Install U8g2 Library
## 5. Install U8g2 Library
Open Arduino IDE, click `Sketch`->`Include Library`->`Manage Libraries...`, search `U8g2` for installing.
#### (1) Open Arduino IDE, then Select `Sketch`->`Include Library`->`Manage Libraries...`, search `M5Stack` and install it
<img src="assets/img/getting_started_pics/m5stack_core/get_started_with_m5stick/install_u8g2.png">
## Example
## 6. Example
The USB cable connects to <mark>[M5Stick built in MPU9250](https://ae01.alicdn.com/kf/HTB1pICNXznuK1RkSmFPq6AuzFXa1.jpg)</mark>, then select your serial port which is connected the M5Stick.
Select a demo example, compile and upload
### 1. Select your board and the serial port
#### (1) Select your board and the serial port
Start up Arduino IDE, and click `Tools -> Boards -> M5Stack-Core-ESP32` to select your board
@@ -82,7 +138,7 @@ Click `Tools -> Ports ->` to select the serial port which is connected with M5St
<img src="assets/img/getting_started_pics/m5stack_core/get_started_with_arduino_m5core/mac/quick_start_arduino_mac_10.png">
### 2. Select an example
#### (2) Select an example
Click `File-> Examples`. Here are some test programs in `M5Stack`->`Stick`
@@ -1,89 +1,133 @@
# M5Stick Quick Start - Arduino Win {docsify-ignore-all}
<!-- ?> We suggest you confirm whether the `USB driver`, `Git` and `Arduino IDE` has installed first. If not, please view this two articles [establish serial connection](en/related_documents/establish_serial_connection) and [Install Git and Arduino IDE](en/related_documents/how_to_install_git_and_arduino). -->
<img src="assets/img/getting_started_pics/m5stick/stick_01.png"><img src="assets/img/getting_started_pics/m5stick/stick_06.png"><img src="assets/img/windows-logo.png">
## Table of Contents
1. [Setting Environment](#setting-environment)
**[1. Install Arduino IDE](#_1-install-Arduino-IDE)**
- [Step1. Download Arduino-ESP32 Support](#step1-download-arduino-esp32-support)
**[2. Install USB to Serial Driver](#_2-Install-USB-to-Serial-Driver)**
- [Step2. Download the M5Stack Lib](#step2-download-the-m5stack-lib)
**[3. Install ESP32 Boards Manager](#_3-Install-ESP32-Boards-Manager)**
- [Step3. Install U8g2 library](#Step3-Install-U8g2-library)
**[4. Install M5Stack Library](#_4-Install-M5Stack-Library)**
2. [Example](#example)
**[5. Install U8g2 Library](#_5-Install-U8g2-Library)**
## 1. Setting Environment
**[6. Example](#_6-Example)**
*(Only two steps to complete setting)*
## 1. Install Arduino IDE
### Step1. Download Arduino-ESP32 Support
<!-- *注意:如果已经安装了 IDE,请直接从[步骤 2](#_2-安装串口驱动) 开始。* -->
Open Arduino IDE, and click `File`->`Peferences`->`Settings`
Open your browser, enter the official website of Arduino https://www.arduino.cc/en/Main/Software
#### (1) click `Windows ZIP file for non admin install` for downloading `Arduino IDE`
<img src="assets/img/getting_started_pics/m5stack_core/get_started_with_arduino_m5core/windows/arduino_cc_package.png">
#### (2) click `JUST DOWNLOAD`
<img src="assets/img/getting_started_pics/m5stack_core/get_started_with_arduino_m5core/windows/arduino_cc_package_02.png">
#### (3) To install IDE, double click Arduino executable file. Keep the default selection throughout this process, including the installation path is also the default.
<img src="assets/img/getting_started_pics/m5stack_core/get_started_with_arduino_m5core/windows/select_arduino_install_path.png">
<img src="assets/img/getting_started_pics/m5stack_core/get_started_with_arduino_m5core/windows/install_arduino_2.png">
## 2. Install USB to Serial Driver
Open your browser, enter the official website of M5Stack https://m5stack.com/download
#### (1) click `Windows` for downloading this installation package and then unzip this package.
<img src="assets/img/getting_started_pics/m5stack_core/get_started_with_arduino_m5core/windows/download_usb_driver_win_01.png">
#### (2) According to your Windows operating system type, select the corresponding driver installation package
* 32-bit Windows operating system, choose `CP210xVCPInstaller_x86_vx.x.x.x.exe`
* 64-bit Windows operating system, choose `CP210xVCPInstaller_x64_vx.x.x.x.exe`
<img src="assets/img/getting_started_pics/establish_serial_connection/windows_install_usb_driver01.png">
#### (3) double click the executable file for installing.
<img src="assets/img/getting_started_pics/establish_serial_connection/windows_install_usb_driver02.png">
<img src="assets/img/getting_started_pics/establish_serial_connection/windows_install_usb_driver03.png">
#### (4) Check the serial port number `COMx`
To comfirm if the USB to Serial Driver was successfully installed already, Check the list of identified COM ports in the `Windows Device Manager`:
Connect the Core to the computer via a USB Type-C cable, open `Windows Device Manager`, click `Ports(COM & LPT)` for checking the list of identified COM ports.
Disconnect M5Core device and connect it back, to verify which port disappears from the list and then shows back again.
<img src="assets/img/getting_started_pics/m5stack_core/get_started_with_arduino_m5core/windows/check_serial_port_01.png">
## 3. Install ESP32 Boards Manager
#### (1) Open IDE, click `File`->`Peferences`->`Settings`
<img src="assets/img/getting_started_pics/m5stack_core/get_started_with_arduino_m5core/windows/quick_start_arduino_win_01.png">
<img src="assets/img/getting_started_pics/m5stack_core/get_started_with_arduino_m5core/windows/quick_start_arduino_win_02.png">
Input last esp32 board manager URL
#### (2) Copy the following ESP32 Boards Manager url to `Additional Boards Manager URLs:`
*Now the last board manager URL: https://dl.espressif.com/dl/package_esp32_index.json*
*ESP32 Boards Manager url: https://dl.espressif.com/dl/package_esp32_index.json*
<img src="assets/img/getting_started_pics/m5stack_core/get_started_with_arduino_m5core/windows/quick_start_arduino_win_03.png">
Click `Tools`->`Board:`->`Boards Manager...`, search `ESP32` in the new pop-up dialog, then click `install`
#### (3) Click `Tools`->`Board:`->`Boards Manager...`
<img src="assets/img/getting_started_pics/m5stack_core/get_started_with_arduino_m5core/windows/quick_start_arduino_win_04.png">
#### (4) Search `ESP32` in the new pop-up dialog, then click `Install`
<img src="assets/img/getting_started_pics/m5stack_core/get_started_with_arduino_m5core/windows/quick_start_arduino_win_05.png">
### Step2. Download the M5Stack Lib
## 4. Install M5Stack Library
Open Arduino IDE, then Select `Sketch`->`Include Library`->`Manage Libraries...`
Search `M5Stack` and install it
#### (1) Open Arduino IDE, then Select `Sketch`->`Include Library`->`Manage Libraries...`
<img src="assets/img/getting_started_pics/m5stack_core/get_started_with_arduino_m5core/windows/quick_start_arduino_win_06.png">
<img src="assets/img/getting_started_pics/m5stack_core/get_started_with_arduino_m5core/windows/install_m5stack_lib_01.png">
<img src="assets/img/getting_started_pics/m5stack_core/get_started_with_arduino_m5core/windows/quick_start_arduino_win_07.png">
#### (2) Search `M5Stack` and install it
!> **Note:** *As shown below, it means you need update*
<img src="assets/img/getting_started_pics/m5stack_core/get_started_with_arduino_m5core/windows/install_m5stack_lib_02.png">
<img src="assets/img/getting_started_pics/m5stack_core/get_started_with_arduino_m5core/windows/update_m5stack_lib.png">
## 5. Install U8g2 Library
### Step3. Install U8g2 library
#### (1) Open Arduino IDE, then Select `Sketch`->`Include Library`->`Manage Libraries...`, search `M5Stack` and install it
If you have installed `U8g2`, then just run and upload your m5stick's poject.
If not, then open Arduino IDE, and click `Sketch`->`Include Library`->`Manage Libraries...` for installing `U8g2` library
<img src="assets/img/getting_started_pics/m5stack_core/get_started_with_m5stick/install_u8g2.png">
<figure>
<img src="assets/img/getting_started_pics/m5stack_core/get_started_with_m5stick/install_u8g2.png">
</figure>
## Example
## 6. Example
This section for verifying whether you can program with Arduino or not. Now, The USB cable connects to <mark>[M5Stick built in MPU9250](https://ae01.alicdn.com/kf/HTB1pICNXznuK1RkSmFPq6AuzFXa1.jpg)</mark>, then select your serial port which is connected the M5Stick.
Select a demo example, compile and upload
### 1. Execute a example likes `FactoryTest.ino`
#### (1) Execute a example likes `FactoryTest.ino`
Select your board name, baudrate, the specified serial port: M5Stack-Core-ESP32, 921600, COM4 (Now, my serial port which is connected with PC is `COM4`)
<img src="assets/img/getting_started_pics/m5stack_core/get_started_with_arduino_m5core/windows/select_board_baudrate_serial_port.png">
<font color="red">Then select an example likes `M5Stack` -> `Stick` -> `FactoryTest.ino`</font>
#### (2) Then select an example likes `FactoryTest.ino`
<font color="red">Then select an example likes M5Stack -> Stick -> FactoryTest.ino</font>
<img src="assets/img/getting_started_pics/m5stick/m5stick_arduino_windows_01.png">
Upload it
#### (3) Upload it
<img src="assets/img/getting_started_pics/m5stack_core/get_started_with_arduino_m5core/windows/arduino_upload.png">
**Phenomenon: After pressing button A, the screen displays "Hello World! Exist"**
**The button located at the bottom left of stick is the power button, click to turn it on, press again to reset when running. If you want to let stick enter deep sleep status, you need to press the power button twice quickly.**
?> *If you want to upgrade the M5Stack Lib, please view this article [upgrade M5Stack Lib](/en/related_documents/upgrade_m5stack_lib).*
@@ -2,14 +2,6 @@
:clapper: **[视频教程](#相关视频)**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:memo: **[文本教程](#目录)**
<!-- ?> a. 如果您的设备还没烧录UIFlow固件的话,请参考这篇文档[如果使用M5Burner烧录固件](/zh_CN/related_documents/how_to_burn_firmware). b. 如果您是第一次使用这个Core或者想Core连接其他可联网的热点AP的话,请参考这篇文档[如果使用Core连接WIFI和UIFlow](/zh_CN/related_documents/how_to_connect_wifi_using_core)。 -->
<!-- 这时候,您的M5Core已经连接到了可联网WIFI热点,如果按下Core上左边的按键`UPLOAD`的话,会如下图显示。如果M5Core开机之后,两三秒内没做操作的话,会自动地显示预置的程序界面。所以最好开机之后,立马按下`upload`按键。
<figure>
<img src="assets/img/getting_started_pics/m5stack_core/get_started_with_uiflow/apikey.jpg">
</figure> -->
## 目录
**[1. 安装串口驱动](#_1-安装串口驱动)**