
Arduino Quick Start
Environment Setup: Refer to the Arduino IDE Getting Started Guide to complete IDE installation, and install the corresponding board manager and required driver libraries for the development board used.
Required Driver Libraries:
Required Hardware Products:


G9 (DIN).#include <M5Unified.h>
#define DIN_PIN GPIO_NUM_9
void setup() {
M5.begin();
M5.Lcd.clear();
M5.Lcd.setFont(&fonts::FreeMonoBold12pt7b);
M5.Lcd.setTextColor(YELLOW, BLACK);
M5.Lcd.setTextDatum(bottom_center);
M5.Lcd.drawCenterString("Unit SSR Example", 160, 100);
pinMode(DIN_PIN, OUTPUT);
}
void loop(void) {
digitalWrite(DIN_PIN, HIGH);
delay(1000);
digitalWrite(DIN_PIN, LOW);
delay(1000);
}
Unit SSR Example. G9 switches between high and low levels every 1 second, causing the AC load controlled by Unit SSR to alternate between on and off in a 1-second cycle. The red LED indicates the on/off status.