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

Moderator: igrr

User avatar
By HobbyGuy
#21053
Code: Select all int reading = analogRead(A0); 
 Serial.print("A0 reading = "); Serial.println(reading);
 float voltage = reading * .95731;
 // print out the voltage
 Serial.print(voltage); Serial.println(" millivolts");
 // now print out the temperature
 float temperatureC = ((voltage - 500) / 10) ;  //converting from 10 mv per degree wit 500 mV offset
                                               //to degrees ((voltage - 500mV) times 100)
 Serial.print(temperatureC); Serial.println(" degrees C");


I've got an Adafruit Huzzah board running this snippet of code and it works reliably. It uses dweet.io to send the temperature to freeboard.io and works nicely.
User avatar
By HobbyGuy
#21055
tytower wrote:Wondered what the serial output looks like?



connected with KindTiger, channel 6
dhcp client start...
.......ip:192.168.1.142,mask:255.255.255.0,gw:192.168.1.1
.
WiFi connected
IP address:
192.168.1.142
A0 reading = 729
697.88 millivolts
19.79 degrees C
67 degrees F
connecting to www.dweet.io
User avatar
By FlyingHacker
#21056 Just curious... Is anyone who is successfully or unsuccessfully reading the analog pin calling pinMode(INPUT) on the analog pin? In theory this is not required for analogRead() because analogRead() calls it, but if you have ever enabled the pull-up on that pin then it will stay pulled up.

However, the symptoms of random readings to not sound like a pulled up input. Of course this is in reference to an Arduino. Not sure how the ESP behaves yet.