machine.Pin.pull_down ?

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
bellad
Posts: 50
Joined: Tue May 14, 2019 1:47 pm

machine.Pin.pull_down ?

Post by bellad » Wed May 20, 2020 8:13 am

Hello,
i have pin out from esp32 ( 1=activ ) , go to stm32 in pin
on stm32 , the pin in , i put machine.Pin.pull_down ? or other
esp32 ( pin out ) -> stm32 (pin in )
thank

SpotlightKid
Posts: 404
Joined: Wed Apr 08, 2015 5:19 am

Re: machine.Pin.pull_down ?

Post by SpotlightKid » Wed May 20, 2020 1:57 pm

Sorry, I don't understand a word of what you have written. Could you try to rephrase it?

bellad
Posts: 50
Joined: Tue May 14, 2019 1:47 pm

Re: machine.Pin.pull_down ?

Post by bellad » Mon May 25, 2020 2:09 pm

sorry for the delay
on my esp32 :

Code: Select all

rel= machine.Pin(16, machine.Pin.OUT)
if a == 0:
rel.value=1
else:
rel.value=0
with a physical wire esp32 to stm32 on PE8

Code: Select all

if PE8 == 1 :
print('ok')
else:
print('no good')
for PE8 declare machine.Pin.pull_down or machine.Pin.pull_up ?

User avatar
dhylands
Posts: 3349
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: machine.Pin.pull_down ?

Post by dhylands » Mon May 25, 2020 4:03 pm

Pull up and pull down are only applicable to input pins. Output pins are driven high or driven low, so pullups don't apply. I think you might be able to use pull up on an open drain output, but that's the only case I can think of tht makes sense.

According to the documentation: http://docs.micropython.org/en/latest/l ... achine.Pin
something like this:

Code: Select all

p = machine.Pin('PE8', mode=machine.Pin.IN, pull=machine.Pin.PULL_UP)

Post Reply