07-11-2026, 02:16 AM
Code:
/*
Made by KinCony IoT: https://www.kincony.com
Monitor GPIO0, GPIO18, GPIO8
Print to Serial when state changes
*/
#define PIN_0 0
#define PIN_18 18
#define PIN_8 8
int lastState0;
int lastState18;
int lastState8;
void setup() {
Serial.begin(115200);
pinMode(PIN_0, INPUT_PULLUP);
pinMode(PIN_18, INPUT_PULLUP);
pinMode(PIN_8, INPUT_PULLUP);
lastState0 = digitalRead(PIN_0);
lastState18 = digitalRead(PIN_18);
lastState8 = digitalRead(PIN_8);
Serial.println("GPIO Monitor Started");
}
void loop() {
int state0 = digitalRead(PIN_0);
if (state0 != lastState0) {
Serial.print("GPIO0 changed to: ");
Serial.println(state0);
lastState0 = state0;
}
int state18 = digitalRead(PIN_18);
if (state18 != lastState18) {
Serial.print("GPIO18 changed to: ");
Serial.println(state18);
lastState18 = state18;
}
int state8 = digitalRead(PIN_8);
if (state8 != lastState8) {
Serial.print("GPIO8 changed to: ");
Serial.println(state8);
lastState8 = state8;
}
delay(10);
}
Free-GPIO.zip (Size: 539 bytes / Downloads: 8)
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download:
Free-GPIO.ino.merged.zip (Size: 180.26 KB / Downloads: 16)
YouTube: https://www.youtube.com/c/KinCony
Online Store: https://shop.kincony.com
Alibaba Store: https://kincony.en.alibaba.com/
Online Store: https://shop.kincony.com
Alibaba Store: https://kincony.en.alibaba.com/

