use analog pin as digital?

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
jose1711@gmail.com
Posts: 3
Joined: Tue Jun 20, 2017 7:40 pm

use analog pin as digital?

Post by jose1711@gmail.com » Tue Jul 11, 2017 8:25 am

hello,

is there any hope for analog pin (a0) on esp8266 to use as sda/scl pin and/or with irq?

thank you,

jose

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: use analog pin as digital?

Post by Roberthh » Tue Jul 11, 2017 9:56 am

No. You can use the analog pin as an slow digital input, in case you are low on ressources, including setting up a multi-position switch. Each reading takes about 100 µs. But you have to poll it, there is no interrupt associated.

Post Reply