-->
Page 3 of 4

Re: ESP8266 ESP12

PostPosted: Mon May 18, 2015 3:53 am
by tytower
P1010015.JPG
Well I've got the DHT22 sensor up and my line was
#define DHT_PIN 2 //DHT dht;//DHT22 for my sensorRHT03-others in library
DHT dht(DHT_PIN,DHT22,15);

I had to get the adafruit library though as the standard library from Arduino does not have the functions needed
https://github.com/adafruit/DHT-sensor-library Their getTemperature() becomes readTemperature() and getPressure() becomes readPressure().

This also confirms the reading pin 2 Which is GPIO5 on the ESP-12 board
Now to see what I can do with the BMP180 which I may have to replace . I suspect I bricked it with 5 V instead of 3.3V .

Il'l let it run now for a bit
Here is where its posting to
https://data.sparkfun.com/streams/RMzp9ANyqzfjw4drzNnZ

Re: ESP8266 ESP12

PostPosted: Mon May 18, 2015 3:55 am
by tytower
burkmurray wrote:I had to add a timing value to the DHT initialization to adjust for the faster processor on the ESP12 vs Uno:
Code: Select allDHT dht(DHTPIN, DHTTYPE, 15);

A value of 11 worked for me, but https://github.com/esp8266/arduino suggests using 15.
Good luck!

Thanks again mate -used 15 as 11 didn't work

Re: ESP8266 ESP12

PostPosted: Sun May 24, 2015 6:10 pm
by tytower
OK in case anyone wants this here is working Arduino IDE code for this ESP12
to send gathered data of BMP180 and DHT22 sensors to "data.sparkfun.com"

I've added an error LED so I can see that something is wrong. At this stage the I2C is not reading properly and I think the librarians are working on this atm

With this all connected up I still have two digital and one analog pins left free

Re: ESP8266 ESP12

PostPosted: Sat May 30, 2015 2:11 am
by tytower
Here is a program to run on the ESP8266-12 or similar which sends the readings from BMP180 and DHT22 to Thingspeak and to Sparkfun , has an error LED and 2 digital pins and one analog pin left over.