Hello to all,
so I am trying to figure out why this is not working, but I am running out of ideas.
I have a few pins that must be set as input and must have pull up on them.
Here is how I did it, but it doesnt work:
for (i = 0; i < inc; i++) {
pinMode(inpin, INPUT);
digitalWrite(inpin, INPUT_PULLUP); // activate 20k pull-up
I have tried then just with one pin and its the same. I am using Blue pill STM32F103C8.
Pin input and Pull-up
Pin input and Pull-up
INPUT_PULLUP is a parameter for pinMode(), not for digitlWrite().
Go to full postCode: Select all
pinMode(inpin, INPUT_PULLUP);
digitalWrite(inpin, HIGH); // use HIGH or LOW
-
- Posts: 505
- Joined: Fri Dec 27, 2019 4:53 pm
- Location: Munich, Germany
- Contact:
Re: Pin input and Pull-up
INPUT_PULLUP is a parameter for pinMode(), not for digitlWrite().
Code: Select all
pinMode(inpin, INPUT_PULLUP);
digitalWrite(inpin, HIGH); // use HIGH or LOW
Last edited by stevestrong on Sat Feb 06, 2021 12:19 pm, edited 2 times in total.
Re: Pin input and Pull-up
it should be pinMode( pin, INPUT_PULLUP)
i used that successfully here
built in pull up resistor, DHT11, DHT22
viewtopic.php?f=7&t=530
i used that successfully here
built in pull up resistor, DHT11, DHT22
viewtopic.php?f=7&t=530
Re: Pin input and Pull-up
https://www.arduino.cc/reference/en/lan ... o/pinmode/
Anyway it seems strange to set a pin in input an do a write....
Anyway it seems strange to set a pin in input an do a write....

Re: Pin input and Pull-up
Ohh, waw, looks i am really blind
Thanks for this, now it works

Thanks for this, now it works
