mirror of
https://github.com/m5stack/m5-docs.git
synced 2026-05-20 10:23:01 -07:00
updated Get Started
updated Get Started(Arduino, Windows)
This commit is contained in:
@@ -5,4 +5,5 @@ git clone --recursive https://github.com/espressif/arduino-esp32.git esp32
|
||||
cd esp32
|
||||
cd tools
|
||||
start get.exe
|
||||
start cmd
|
||||
start cmd
|
||||
pause
|
||||
@@ -1,5 +1,5 @@
|
||||
M5Stack Core Get Started(Windows, Arduino)
|
||||
===========================================
|
||||
M5Stack-Core Get Started(Windows, Arudino)
|
||||
==========================================
|
||||
|
||||
.. note::
|
||||
If your OS is MacOS, please click `here`_.
|
||||
@@ -27,108 +27,85 @@ CONTENT
|
||||
|
||||
.. _upgrade M5Stack Lib: upgrade_m5stack_lib.html
|
||||
|
||||
|
||||
Setting Environment
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. note::
|
||||
Before setting the development environment, we suggest you confirm whether the USB driver has installed. If not, please view this article `establish_serial_connection`_.
|
||||
|
||||
Before setting the development environment, we suggest you confirm whether the USB driver has installed. If not, please visit this link `establish_serial_connection`_.
|
||||
.. _establish_serial_connection: https://github.com/m5stack/m5stack-documentation/blob/master/en/get-started/establish_serial_connection.md
|
||||
|
||||
.. _establish_serial_connection: establish_serial_connection.html
|
||||
|
||||
1. Install ``Arduino IDE``
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
*download address* https://www.arduino.cc/en/Main/Software
|
||||
|
||||
.. image:: ../../_static/screenshots/arduino_cc_package.png
|
||||
|
||||
modified the path of Arduino as ``D:\Program Files`` as shown below
|
||||
|
||||
.. image:: ../../_static/screenshots/select_arduino_install_path.png
|
||||
|
||||
Now my path of Arduino is ``D:\Program Files\Arduino``
|
||||
|
||||
.. image:: ../../_static/screenshots/arduino_path.png
|
||||
|
||||
2. Download Toolchain
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
(Now my path of Arduino is ``D:\Program Files\Arduino``\ )
|
||||
|
||||
Enter the path ``D:\Program Files\Arduino\hareware`` via the terminal of
|
||||
Windows
|
||||
|
||||
Execute the following commands on the terminal of Windows > \* new a
|
||||
directory named ``espressif``, then enter this directory
|
||||
|
||||
mkdir espressif && cd espressif
|
||||
|
||||
.. image:: ../../_static/screenshots/mkdir_espressif.png
|
||||
|
||||
|
||||
- clone ``esp32 idf`` at the directory named ``esp32``
|
||||
|
||||
git clone --recursive https://github.com/espressif/arduino-esp32.git
|
||||
esp32
|
||||
|
||||
.. image:: ../../_static/screenshots/download_idf.png
|
||||
|
||||
3. ESP32 Toolchain
|
||||
1. Install ``Git``
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Enter the path
|
||||
``D:\Program Files\arduino\hardware\espressif\esp32\tools`` double click
|
||||
on ``get.exe``
|
||||
If you has installed ``Git``, please following next setp 2
|
||||
straight.Otherwise, download the client of
|
||||
`Git <https://git-scm.com/download/win>`__ and install it.
|
||||
|
||||
.. image:: ../../_static/screenshots/select_get_exe_file.png
|
||||
2. Install ``Arduino IDE``
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. image:: ../../_static/screenshots/download_xtensa_tools.png
|
||||
*download address*
|
||||
|
||||
4. Download the M5Stack Lib via Arduino IDE
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
https://www.arduino.cc/en/Main/Software
|
||||
|
||||
Open Arduino IDE, then Select
|
||||
``Sketch``->``Include Library``->``Manage Libraries...`` Search
|
||||
``M5Stack`` and install it
|
||||
.. image:: ../../_static/getting_started_pics/m5stack_core/arduino_cc_package.png
|
||||
|
||||
.. image:: ../../_static/screenshots/select_arduino_lib.png
|
||||
Double click to install Arduino IDE
|
||||
|
||||
.. image:: ../../_static/screenshots/download_m5stack_lib.png
|
||||
.. image:: ../../_static/getting_started_pics/m5stack_core/select_arduino_install_path.png
|
||||
|
||||
.. image:: ../../_static/getting_started_pics/m5stack_core/install_arduino_2.png
|
||||
|
||||
3. Download Arduino-ESP32 Support
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Download the batch file `download\_arduino\_esp32\_support.bat <https://github.com/m5stack/m5stack-documentation/blob/master/en/get-started/download_arduino_esp32_support.bat>`__, and execte it as Administrator.
|
||||
|
||||
.. image:: ../../_static/getting_started_pics/m5stack_core/execute_batch_file.png
|
||||
|
||||
Then a new window will appear as shown below. Please waiting for cloning...
|
||||
|
||||
.. image:: ../../_static/getting_started_pics/m5stack_core/execute_batch_file_for_downloading_arduino_esp32.png
|
||||
|
||||
As shown below, it means Arduino-ESP32 Support has completed.
|
||||
|
||||
.. image:: ../../_static/getting_started_pics/m5stack_core/download_arduino_esp32_completed.png
|
||||
|
||||
4. Download the M5Stack Lib
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Open Arduino IDE, then Select ``Sketch`` -> ``Include Library`` -> ``Manage Libraries...`` Search ``M5Stack`` and install it
|
||||
|
||||
.. image:: ../../_static/getting_started_pics/m5stack_core/install_m5stack_lib_01.png
|
||||
|
||||
.. image:: ../../_static/getting_started_pics/m5stack_core/install_m5stack_lib_02.png
|
||||
|
||||
.. note::
|
||||
|
||||
As shown below, it means you need update
|
||||
|
||||
.. image:: ../../_static/getting_started_pics/m5stack_core/update_m5stack_lib.png
|
||||
|
||||
Example
|
||||
~~~~~~~
|
||||
|
||||
The USB cable connects to M5Stack Core, then select your serial port
|
||||
which is connected M5Stack Core. Select a demo example, compile and
|
||||
upload
|
||||
The USB cable connects to M5Stack Core, then select your serial port which is connected M5Stack Core. Select a demo example, compile and upload.
|
||||
|
||||
1. Open a example likes ``FactoryTest.ino``
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
1. Execute a example likes ``FactoryTest.ino``
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. image:: ../../_static/screenshots/select_demo.png
|
||||
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``)
|
||||
|
||||
.. note::
|
||||
.. image:: ../../_static/getting_started_pics/m5stack_core/select_board_baudrate_serial_port.png
|
||||
|
||||
If you got a situation which appears ``INCOMPATIBLE`` when opening a M5Stack example as shown below.
|
||||
Then select an example likes ``FactoryTest.ino``
|
||||
|
||||
.. image:: ../../_static/getting_started_pics/m5stack_core/incompatible.jpg
|
||||
.. image:: ../../_static/getting_started_pics/m5stack_core/select_an_example.png
|
||||
|
||||
Upload it
|
||||
|
||||
Please select ``Tools -> Boards -> M5Stack-Core-ESP32``
|
||||
|
||||
.. image:: ../../_static/getting_started_pics/m5stack_core/select_m5stack_core_board.jpg
|
||||
|
||||
|
||||
Comfire your board name, baudrate, the specified serial port:
|
||||
M5Stack-Core-ESP32、921600、COM3
|
||||
|
||||
.. image:: ../../_static/screenshots/select_board_and_com.png
|
||||
|
||||
After upload seccessfully, open the Serial Monitor
|
||||
|
||||
.. image:: ../../_static/screenshots/FactoryTest_result.png
|
||||
.. image:: ../../_static/getting_started_pics/m5stack_core/arduino_upload.png
|
||||
|
||||
2. New a M5Stack program
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@@ -157,5 +134,4 @@ Copy the below code to my\_test.ino
|
||||
|
||||
}
|
||||
|
||||
compile it and upload, the M5Stack screen will show "Hello World!"
|
||||
"M5Stack is running successfully!"
|
||||
compile it and upload, the M5Stack screen will show "Hello World!" "M5Stack is running successfully!"
|
||||
|
||||
@@ -1,156 +0,0 @@
|
||||
M5Stack Core Get Started(Windows, MicroPython)
|
||||
==============================================
|
||||
|
||||
CONTENT
|
||||
~~~~~~~
|
||||
|
||||
1. `Burn Firmware <#Burn-Firmwared>`__
|
||||
|
||||
- `1. Download Firmware <#1-download-firmware>`__
|
||||
|
||||
- `2. Burn to M5Stack <#2-Burn-to-M5Stack>`__
|
||||
|
||||
2. `Connect Wi-Fi <#connect-wi-fi>`__
|
||||
|
||||
3. `Binding device <#binding-device>`__
|
||||
|
||||
4. `Coding MicroPython <#coding-micropython>`__
|
||||
|
||||
.. note::
|
||||
Before programing through Blockly(or MicroPython), you need to burn a appropriate firmware to your board follwing this article `How to burn firmare`_.
|
||||
|
||||
.. _How to burn firmare: how_to_burn_firmware_en.html
|
||||
|
||||
Connect the LAN
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
.. note::
|
||||
|
||||
M5Flow和M5GO连接wifi的界面和步骤完全不一样
|
||||
输入checkcode也是不一样
|
||||
连接也是不一样
|
||||
|
||||
m5cloud m5go m5flow
|
||||
|
||||
Burn Firmware
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
1. Download Firmware
|
||||
^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
https://github.com/m5stack/M5Cloud/tree/master/firmwares
|
||||
|
||||
Now, the M5Cloud firmware I downloaded named
|
||||
``m5cloud-20180516-v0.4.0.bin`` and it saved at ``~/smbshare``
|
||||
|
||||
2. Burn to M5Stack
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
|
||||
+-----------+-----------+-----------+
|
||||
| |image| | |image| | |image| |
|
||||
+===========+===========+===========+
|
||||
| Windows | Linux | MacOS |
|
||||
+-----------+-----------+-----------+
|
||||
|
||||
***Windows***
|
||||
|
||||
open Flash Download
|
||||
Tools(\ `点击下载 <https://www.espressif.com/sites/default/files/tools/flash_download_tools_v3.6.4.rar>`__)
|
||||
apply by Espressif, choose ``ESP32 DownloadTool`` option and execute
|
||||
three steps ( *choose firmware file, your serial port, erase and program
|
||||
flash* ) as shown below
|
||||
|
||||
.. figure:: ../../_static/M5Stack_MicroPython_UserGuidePictures/windows_download_firmware.png
|
||||
:alt: image
|
||||
|
||||
image
|
||||
***MacOS/Linux***
|
||||
|
||||
*1. Check port on Linux and MacOS*
|
||||
|
||||
To check the device name for the serial port of your M5Stack board (or
|
||||
external converter dongle), run this command two times, first with the
|
||||
board / dongle unplugged, then with plugged in. The port which appears
|
||||
the second time is the one you need:
|
||||
|
||||
Linux
|
||||
|
||||
``ls /dev/tty*``
|
||||
|
||||
MacOS
|
||||
|
||||
``ls /dev/cu.*``
|
||||
|
||||
*2. Adding user to ``dialout`` on Linux*
|
||||
|
||||
The currently logged user should have read and write access the serial
|
||||
port over USB. On most Linux distributions, this is done by adding the
|
||||
user to ``dialout`` group with the following command:
|
||||
|
||||
``sudo usermod -a -G dialout $USER`` Now, my serial port named
|
||||
``ttyUSB0``
|
||||
|
||||
*3. Download M5Cloud firmware to M5Stack board* - Installing esptool:
|
||||
``pip install esptool`` - Erase flash on M5Stack:
|
||||
``esptool.py --chip esp32 --port /dev/ttyUSB0 erase_flash`` - Download
|
||||
firmware to M5Stack:
|
||||
``esptool.py --chip esp32 --port /dev/ttyUSB0 write_flash --flash_mode dio -z 0x1000 m5cloud-20180516-v0.4.0.bin``
|
||||
|
||||
Connect Wi-Fi
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
Mobile Phone or PC connect to M5Stack AP(like ``M5Stack-a67c``), and
|
||||
then open brower to login 192.168.4.1 setting your LAN SSID and Password
|
||||
|
||||
.. figure:: ../../_static/M5Stack_MicroPython_UserGuidePictures/m5stack_connet_wifi.png
|
||||
:alt: image
|
||||
|
||||
image
|
||||
Binding device
|
||||
~~~~~~~~~~~~~~
|
||||
|
||||
*1.login http://io.m5stack.com and register your own account(or login
|
||||
your account)*
|
||||
|
||||
*2. press ``Device->Add`` buttom on M5Cloud IDE for binding M5Stack
|
||||
board to your account*
|
||||
|
||||
*3. Input the Check Code for the M5Stack screen display,Check Code is
|
||||
random, after 60s will refresh*
|
||||
|
||||
.. figure:: ../../_static/M5Stack_MicroPython_UserGuidePictures/WebIDE_check_code.png
|
||||
:alt: image
|
||||
|
||||
image
|
||||
Coding MicroPython
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
*1. create a new python project*
|
||||
|
||||
.. figure:: ../../_static/M5Stack_MicroPython_UserGuidePictures/create_a_new_project.png
|
||||
:alt: image
|
||||
|
||||
image
|
||||
*2. write your own code and press ``Upload & Run`` buttom on the M5Cloud
|
||||
IDE*
|
||||
|
||||
copy below code to ``main.py`` file and press ``Upload & Run``
|
||||
|
||||
.. code:: python
|
||||
|
||||
from m5stack import lcd
|
||||
|
||||
lcd.clear()
|
||||
lcd.setCursor(0, 0)
|
||||
lcd.setColor(lcd.WHITE)
|
||||
|
||||
lcd.print("Hello World!")
|
||||
|
||||
.. figure:: ../../_static/M5Stack_MicroPython_UserGuidePictures/display_hello_world.png
|
||||
:alt: image
|
||||
|
||||
image
|
||||
|
||||
.. |image| image:: ../../_static/windows-logo.png
|
||||
.. |image| image:: ../../_static/linux-logo.png
|
||||
.. |image| image:: ../../_static/macos-logo.png
|
||||
Reference in New Issue
Block a user