Trouble with esp32c3 seeedstudio

Hi

I thinking im going insane or something.
I just cant get it how to use a pin as a input.
I have Google and tried for a while now.
Could a kind soul providing a code example for.
When D1 gets 3.3v, then put the d2 as an output and send out a one.
?

Also can i take a cable from the 3.3v to the D1 to try it without a resistors or should i get one?
Is it possibly to detect rising or falling Edge?

refer to the ESP32-c3 pinout -
there is no D1 you are thinking of another microcontroller
you should be able to read GPIO2 on pin 1 and output the value on GPIO3 pin 2 - see digitalIO
you can connect the 3.3V or GND to a digital input pin (make sure it is input)
to detect edges see attachinterupt()
e.g. this displays the value on pin GPIO3

void setup() {
  Serial.begin(115200);
}

void loop() {
  int pin=digitalRead(3);
  Serial.printf("pin 3 %d\n", pin);
  delay(1000);
}

Edit: have a look at esp32-digital-inputs-outputs-arduino

1 Like

According to seeed.... wiki they have the sam pic but with the difference that they have marked out Dx. Starting D0 on GOIO2 and going anti clock wise on the pins and ends in D10 at GPIO10.
Also i just saw now, that in your first url scrolling down from the pictures there is a list were they mentioned D1.
So yes we are speaking if the same microcontroller.

Regarding this line:

What GPIO do you read? I guessing GPIO 5 or 6?

I have failed to found a pin spec that the GPIO, for what is the threshold voltage when its considered a 1 or a 0, maximum voltage/current its abel to receive and delivers and just noticed the 3v3 pin.
I think i read somewhere its for 3.3v but couldn't find it on the wiki now. Is the 3v3=3.3v?

Much thanks for the help btw

The ESP32-C3 I have is Espressif ESP32-C3-DevKitM-1 - the pin lables vary from dev board to dev board
you need to refer to the pinout diagrams to determine what pins match the actual GPIOs
in the program of post 2

int pin=digitalRead(3);

3 refers to GPIO3


So by looking at this pic and the code
int pin=digitalRead(3);

Its going to read on the second pin on the left side of the board referred as GPIO3 A1 D1.
Am i correct?

I don't have a esp32c3 seeedstudio to check but I would assume so
try running the program - with nothing attached it will probably display 1 - if you connect the pin to GND it should display 0

Do i need a externa resistor, due to not getting consistency results. Getting confused over pull up or down resistor.

I run a cabel from the vcc to a switch then to a input. Just to know the state of that switch.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.