Hey Guys,
I've a problem during Uploading to my Devboard (ESP32-WROOM-32U). After the see to 'Connecting..........' on output terminal , I get the error 'A fatal error occurred: Could not connect to ESP32: Incorrect boot mode detected (0xb)! The chip must be in download mode. '
I also tried the solution of holding the BOOT button pressed during download, but it continues to work the same way.
// Pin assignments
const int inputPins[8] = {32, 33, 34, 35, 36, 39, 25, 26}; // INPUT pins
const int outputPins[8] = {2, 4, 5, 18, 19, 21, 22, 23}; // Relay Output Pins
void setup() {
Serial.begin(115200);
// Set inputs to INPUT
for (int i = 0; i < 8; i++) {
pinMode(inputPins[i], INPUT);
}
// Set outputs to OUTPUT
for (int i = 0; i < 8; i++) {
pinMode(outputPins[i], OUTPUT);
digitalWrite(outputPins[i], LOW); // Keep relays closed at startup
}
Serial.println("Enter command (1-8):");
}
void loop() {
// Constantly check the input pins
for (int i = 0; i < 8; i++) {
if (digitalRead(inputPins[i]) == HIGH) {
digitalWrite(outputPins[i], HIGH);
} else {
digitalWrite(outputPins[i], LOW);
}
}
// Process commands from serial terminal
if (Serial.available()) {
char cmd = Serial.read();
if (cmd >= '1' && cmd <= '8') {
int index = cmd - '1';
digitalWrite(outputPins[index], HIGH);
delay(500); // Keep the relay ON for 500 ms
digitalWrite(outputPins[index], LOW);
Serial.print("RELAY ");
Serial.print(index + 1);
Serial.println(" triggered.");
}
}
}