Using the new Arduino IDE for ESP8266 and found bugs, report them here

Moderator: igrr

User avatar
By tytower
#21140 So when measuring the system voltage one must disconnect any wires to TOUT (ADC) and then the measure received by that function is between 0 and 1 volt . I don't understand that bit.It seems to contradict itself

If i connect a voltage on my ADC up to source voltage it reads that voltage correctly . It is not limited to 1 Volt that i have seen. I am using an ESP-12 for this with 9.5 firmware
User avatar
By bernd331
#21203
bernd331 wrote:
Code is only the fragments you need. Not a running program. But with this, I get reliable values from the ADC. Arduino IDE is 1.6.4. Greetz, Bernd”
THNX a bunch.. your code-snipet helped a lot and now it is working fine (even on my olimex)..


When I'm right you wanna connect a LDR. I've done this also but a disadvantage is that you use for this the only ADC from the ESP. Currently I try to beconme a BH1750FVI Lightintensitiy sensor to run. This one uses I2C and keeps the ADC free so it's possible to measure for example the battery voltage... only as an idea...

Greetz, Bernd
User avatar
By biol75
#49648
bernd331 wrote:Sorry for the long time to answer. Here are my promised solution to get reliable analog read values from an LDR.

Code: Select allextern "C" {
#include "user_interface.h"
}

uint LDR_Value = 0; //Value of LDR (ADC)

LDR_Value=system_adc_read();


Code is only the fragments you need. Not a running program. But with this, I get reliable values from the ADC. Arduino IDE is 1.6.4.

Greetz, Bernd


Thanks - this was very helpful. In Arduino 1.6.7 / ESP 2.0.0 analogRead is fine in the main loop, but not in an interrupt handler. system_adc_read worked fine in the interrupt handler
chris
User avatar
By daniel_ezsbc
#64287 The ADC does work but it's a bit strange. The maximum analog input voltage is just 1V and higher voltages cause strange results. I use a 5.36k and 1k voltage divider before the analog input pin and I get good results

Daniel