Is it possible to read current pin state

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
lazarvgd
Posts: 5
Joined: Sun May 20, 2018 8:57 am

Is it possible to read current pin state

Post by lazarvgd » Mon May 21, 2018 7:23 pm

Hi there,

I am looking for feature in micropython so I can track output pins on esp8266 boards.

According to this answer it is possible to achieve in Arduino C, but does it work for mycropython? https://arduino.stackexchange.com/a/36350/34626

Thanks :)

OutoftheBOTS_
Posts: 377
Joined: Mon Nov 20, 2017 10:18 am

Re: Is it possible to read current pin state

Post by OutoftheBOTS_ » Mon May 21, 2018 9:10 pm

from the docs
Pin.value([x])

This method allows to set and get the value of the pin, depending on whether the argument x is supplied or not.

If the argument is omitted then this method gets the digital logic level of the pin, returning 0 or 1 corresponding to low and high voltage signals respectively. The behaviour of this method depends on the mode of the pin:
see at http://docs.micropython.org/en/v1.9.3/e ... e.Pin.html

Post Reply