-
• #2
I also get the same problem (adc is undefined) with this code:
print(adc.read(0))
-
• #3
Try
analogRead(D0)
, but I'm not sure anyone has tested the ADC functionality. The docs don't match reality, we need help from Gordon to define the A0 pin for the esp8266... -
• #4
Ah, that did it, thank you.
-
• #6
Agreed. If you could add an appropriate definition to the board file that defines an A0 pin, I would appreciate. I tried and failed.
-
• #7
@user59035 is this the board you are using ?
http://www.14core.com/wp-content/uploads/2015/06/Node-MCU-Pin-Out-Diagram1.png -
• #8
any update on this? I'm getting A0 undefined (v 1.87)
thx
David -
• #10
I think analogRead() ignores the argument you pass to it on the ESP8266... there's only one pin for which analogRead() is meaningful.
-
• #11
1v87.223 Copyright 2016 G.Williams Espruino is Open Source. Our work is supported only by sales of official boards and donations: http://espruino.com/Donate Flash map 4MB:512/512, manuf 0xe0 chip 0x4016
NodeMCU v3 + Espruino
analogRead();
Do not working.
1 Attachment
I have an NODEMCU and installed the chrome extension for espruino - but when I try and run this code:
I get this:
What's going on?