Hey guys,
so I am using the esp32 wroom 32. But I am searching for the numbers to define the pins I have tried to just set them by the names on the boards (G0 to 0) but I've got a problem. if I set every pin to INPUT and check if anything is connected it doesnt work. If I am connecting G2 with G4 (all set INPUT), G0 is connected, same thing to when I dont have anything connected. All the time it shows me that G0 is connected. If I connect anything with G0 it works and the other pin also shows as connected but only with G0.
Thats why I thought I'm maybe using the wrong definitions for my Arduino.
#include <Arduino.h>
int pinsToCheck[] = {32, 33, 34, 35, 25, 26, 27, 14, 12, 13, 2, 3, 23, 22, 19, 18, 17, 16, 4, 2, 15};
int numPins = sizeof(pinsToCheck) / sizeof(pinsToCheck[0]);
void setup() {
Serial.begin(9600);
for (int i = 0; i < numPins; ++i) {
pinMode(pinsToCheck[i], INPUT);
}
while (!Serial) {
// Warte, bis die serielle Verbindung hergestellt ist
}
}
void loop() {
for (int i = 0; i < numPins; ++i) {
int pinState1 = digitalRead(pinsToCheck[i]);
Serial.print("Pin ");
Serial.print(pinsToCheck[i]);
Serial.print(" State: ");
Serial.println(pinState1);
for (int j = i + 1; j < numPins; ++j) {
int pinState2 = digitalRead(pinsToCheck[j]);
Serial.print("Pin ");
Serial.print(pinsToCheck[j]);
Serial.print(" State: ");
Serial.println(pinState2);
if (pinState1 && pinState2) {
Serial.print("Connected: ");
Serial.print("Pin ");
Serial.print(pinsToCheck[i]);
Serial.print(" and Pin ");
Serial.println(pinsToCheck[j]);
}
}
}
Serial.println(); // Leere Zeile für bessere Lesbarkeit im Serial Monitor
delay(1000);
}
I have installed it already but cant find it I am sorry, is it just generic ESP32 and is it all the way on the top of the list? Thank you very much for your help