Arduino IDE environment - M5Core

Driver Installation

Click the link below to download the driver that matches the operating system. There are currently two driver chip versions (CP210X/CH9102). Please download the corresponding driver compressed package according to the version you are using. After decompressing the compressed package, select the installation package corresponding to the number of operating systems to install. (If you are not sure of the USB chip used by your device, you can install both drivers at the same time. During the installation process of CH9102_VCP_SER_MacOS v1.7, an error may occur, but the installation is actually completed, just ignore it.)

Driver name Applicable driver chip Download link
CP210x_VCP_Windows CP2104 Download
CP210x_VCP_MacOS CP2104 Download
CP210x_VCP_Linux CP2104 Download
CH9102_VCP_SER_Windows CH9102 Download
CH9102_VCP_SER_MacOS v1.7 CH9102 Download

Arduino Development Environment Setup Tutorial

[Click to view] Arduino development environment setup tutorial

M5Stack's board management

    1. Open the Arduino IDE, select File->Preferences->Settings
    1. Copy the M5Stack board management URL below to the Additional Development Board Manager:
https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/arduino/package_m5stack_index.json
    1. Select Tools->Development Board:->Development Board Manager...
    1. In the new pop-up dialog box, enter and search for M5Stack, click Install (If the search fails, you can try to restart the Arduino program)
  • 5.Select Tools->Development board:->M5Stack Arduino, select the corresponding development board configuration according to the device we are using (M5Stack-Core-ESP32).
  • Different hardware devices have different sample program libraries. Please choose to download according to the device you are using. Open the Arduino IDE, and then select Project->Load Library->Library Management...

For M5Core

  • Search for M5Stack and install it, as shown in the figure below. When downloading, please follow the pop-up prompts to install related dependent libraries.

Hello World

  • Copy the code below to the Arduino IDE for arduino esp32 , connect M5Core to the PC and configure the correct port (Tools-> Port-> COMx), click the upload button (->) on the menu bar, the program will It will be automatically compiled and uploaded to the device. The program will print the "Hello World" string on the M5Core screen.

#include <M5Stack.h>

/* After M5Core is started or reset
the program in the setUp () function will be run, and this part will only be run once.
After M5Core is started or reset, it will start to execute the program in the setup() function, and this part will only be executed once. */
void setup(){
  M5.begin(); //Init M5Core. Initialize M5Core
  M5.Power.begin(); //Init Power module. Initialize the power module
                    /* Power chip connected to gpio21, gpio22, I2C device
                      Set battery charging voltage and current
                      If used battery, please call this function in your project */
  M5.Lcd.print("Hello World"); // Print text on the screen (string) Print text on the screen (string)
}

/* After the program in setup() runs, it runs the program in loop()
The loop() function is an infinite loop in which the program runs repeatedly
After the program in the setup() function is executed, the program in the loop() function will be executed
The loop() function is an endless loop, in which the program will continue to run repeatedly */
void loop() {

}
On This Page