Analog read lolin v3 #5989
Replies: 1 comment
-
Posted at 2018-01-24 by DrAzzy You should be able to analogRead() on an ESP8266. There's only that one ADC pin, but last I checked reading from it worked fine. You don't need to do pinMode(). Actually, with Espruino, you don't need pinMode() at all for doing basic GPIO - if pinMode() hasn't been called yet on the pin, digitalRead() will set it as input and digitalWrite() will set it as output. If pinMode() has been called already, it will leave it as is. As an aside, you don't need to use pinMode() before analogRead in Arduino-land either, since pins start as inputs (at least for AVRs; I think same is true for ESP8266 though) Posted at 2018-01-24 by Gustav Well that's lovely! Thank you for such a great answer! Do i need some kind of resistor for reading a basic soil sensor? Posted at 2018-01-24 by DrAzzy What kind of sensor is this? There are several designs. You'll probably need a voltage divider to get the 0 Posted at 2018-01-25 by Gustav It's one of thoose chines sensors, posting pic, i think they might do it for me. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2018-01-24 by Gustav
Can you analogread with a NodeMcu esp8266 lolin v3 board? Can't set pinmode, since it ain't supported ?
Beta Was this translation helpful? Give feedback.
All reactions