
Arduino Quick Start
APIs and example programs related to the Chain DualKey Switch.
#define SWITCH_BLE 8
#define SWITCH_WIFI 7
void setup() {
pinMode(SWITCH_BLE, INPUT);
pinMode(SWITCH_WIFI, INPUT);
Serial.begin(115200);
}
void loop() {
if (digitalRead(SWITCH_BLE) == HIGH) {
Serial.println("Switch in BLE position");
} else if (digitalRead(SWITCH_WIFI) == HIGH) {
Serial.println("Switch in WIFI position");
} else {
Serial.println("Switch in middle position");
}
delay(500);
}This program checks the switch position every 500 milliseconds and prints the current state message to the Serial Monitor:
