pdf-icon

Arduino Quick Start

2. Devices & Examples

DinMeter Arduino Example Program Compilation and Upload

1. Preparation

2. Operation Instructions

Power On/Off Operation
Power on: Wake up by pressing the “WAKE” button or via an RTC timer IRQ signal. After the wake‑up trigger, your setup() must drive the HOLD pin (G46) high to maintain power; otherwise the device will immediately re‑enter sleep. Power off: Without USB external power, press the RST button; or in software, set HOLD (GPIO46) = 0 to cut power when no USB supply.
Download Mode
To enter download mode, hold down the G0 button on the StampS3 before powering on; release it after power is applied.
schematics

3. Port Selection & Configuration

  • Connect the device to your PC via USB. After the driver installs, select the corresponding board and COM port in the Arduino IDE.

4. Program Compilation & Upload

Hello World

  1. In the Arduino IDE, create a new sketch and paste the Hello World example below.
  2. Compile and upload to your device. The screen and Serial Monitor will display “Hello World!”
cpp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
#include <M5Unified.h>
//––– Adjust these to position your text –––
static const int16_t X_POS = 0; // horizontal pixel offset
static const int16_t Y_POS = 60; // vertical pixel offset
void setup() {
auto cfg = M5.config();
M5.begin(cfg);
M5.Display.setTextSize(2);
M5.Display.setCursor(X_POS, Y_POS);
M5.Display.println("Hello World!");
Serial.begin(115200);
Serial.println("Hello World!!!");
}
void loop() {
// nothing here
}

After uploading, you can see the following effect:

5.M5DinMeter Examples

  • Open the M5DinMeter library examples in the Arduino IDE and upload
On This Page