Skip to content

Instantly share code, notes, and snippets.

@maxpromer
Created June 13, 2025 04:29
Show Gist options
  • Save maxpromer/982e20b3353b8193e5120cffef4f6167 to your computer and use it in GitHub Desktop.
Save maxpromer/982e20b3353b8193e5120cffef4f6167 to your computer and use it in GitHub Desktop.
C3-Relay Blink
void setup() {
pinMode(3, OUTPUT); // กำหนดขาเชื่อมต่อรีเลย์ (GPIO3) เป็นดิจิทัลเอาต์พุต
}
void loop() {
digitalWrite(3, HIGH); // สั่งรีเลย์ทำงาน
delay(1000); // หน่วงเวลา 1 วินาที (1000 mS)
digitalWrite(3, LOW); // สั่งรีเลย์หยุดทำงาน
delay(1000); // หน่วงเวลา 1 วินาที (1000 mS)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment