Arduino IDE environment - M5StickC

Driver Installation

Connect the device to the PC. If the port cannot be recognized normally, the user can manually install the FTDI driver to fix the problem. Take the win10 environment as an example, download the driver file that matches the operating system, unzip it, and install it through the device manager. (Note: In some system environments, the driver needs to be installed twice for the driver to take effect. The unrecognized device name is usually M5Stack or USB Serial. Windows recommends using the driver file to install directly in the device manager (custom Update), the executable file installation method may not work properly). Click here to download FTDI driver

For MacOS users, please tick System Preferences -> Security and Privacy -> General -> Allow downloadable apps from the following locations -> App Store and Approved Developer Options .

Arduino-IDE

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, and select the corresponding development board configuration according to the device we are using (M5Stick-C).
  • 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 M5StickC

  • Search for M5StickC 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, connect M5StickC 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 M5StickC screen.

#include <M5StickC.h>

/* After M5StickC is started or reset
  the program in the setUp () function will be run, and this part will only be run once.
  After M5StickC is started or reset, the program in the setup() function will be executed, and this part will only be executed once. */
void setup(){
  // Initialize the M5StickC object. Initialize the M5StickC object
  M5.begin();

  // LCD display. LCd display
  M5.Lcd.print("Hello World");
}

/* 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