pdf-icon

Arduino Quick Start

2. Devices & Examples

Air Quality Arduino Example Compilation & Upload

1. Preparation

2. Download Mode

  • Before powering on, press and hold the G0 button on the Air Quality module, then connect the USB cable for power to enter download mode.

3. Port Selection & Configuration

  • Connect the device to your computer via USB. After the driver installation is complete, you can select the corresponding board and port in the Arduino IDE.

4. Program Compilation & Upload

Hello World

In the Arduino IDE, create a new sketch and paste the Hello World example code below. Compile and upload it to the device; the display and serial monitor will show “HelloWorld!”

cpp
1 2 3 4 5 6 7 8 9 10 11 12 13
#include <M5Unified.h>
void setup() {
auto cfg = M5.config();
M5.begin(cfg);
M5.Display.setTextSize(3);
M5.Display.println("HelloWorld!");
Serial.println("Hello World!!!");
}
void loop() {
}
  1. After uploading, you will see the following result:
On This Page