Arduino IDE environment - M5CoreS3

M5CoreS3 Development Environment Setup Tutorial

[Click to view] M5CoreS3 development environment setup tutorial

M5CoreS3 Library Installation Management

[Click to view] M5CoreS3 Library Installation Management

Hello World

  • Copy the code below to the Arduino IDE, connect M5CoreS3 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 screen of M5CoreS3.
#include <M5CoreS3.h>

/* After M5CoreS3 is started or reset the program in the setUp()
function will be run, and this part will only be run once.
在 M5CoreS3启动或者复位后,即会开始执行setup()函数中的程序,该部分只会执行一次。
*/
void setup() {
    M5.begin(true, true, false);  // Init M5CoreS3.  初始化 M5CoreS3
    M5.Lcd.setTextSize(2);        // Set text size. 设置文字大小
    M5.Lcd.setCursor(100, 120);   // Set the cursor. 设置光标位置
    M5.Lcd.print("Hello World");  // 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
在setup()函数中的程序执行完后,会接着执行loop()函数中的程序
loop()函数是一个死循环,其中的程序会不断的重复运行 */
void loop() {
    USBSerial.println(
        "Hello World");  // Print text on the serial port.在串口输出文本
    delay(500);          // Delay 500ms.  延迟500ms
}