ESP8266/Temp: Difference between revisions
Jump to navigation
Jump to search
#990000 go go what teh temp? |
m sudo coded |
||
| Line 1: | Line 1: | ||
Temperature Sensing with Dallas DS18B20 | Temperature Sensing with Dallas DS18B20 | ||
<pre> | |||
// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs) | |||
// Pass the GPIO pin number sensor(s) is connected to | |||
OneWire oneWire(13); | |||
// Pass our oneWire reference to Dallas Temperature. | |||
DallasTemperature sensors(&oneWire); | |||
// Put this in setup() | |||
sensors.begin(); | |||
// Put this where you want to read temp | |||
sensors.requestTemperatures(); | |||
sensors.getTempCByIndex(0); | |||
</pre> | |||
== Dallas Library == | == Dallas Library == | ||
Revision as of 19:34, 23 November 2015
Temperature Sensing with Dallas DS18B20
// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs) // Pass the GPIO pin number sensor(s) is connected to OneWire oneWire(13); // Pass our oneWire reference to Dallas Temperature. DallasTemperature sensors(&oneWire); // Put this in setup() sensors.begin(); // Put this where you want to read temp sensors.requestTemperatures(); sensors.getTempCByIndex(0);
Dallas Library
http://www.milesburton.com/?title=Dallas_Temperature_Control_Library
Library Download:
References
- Sensor Data Sheet
- Arduino Reference Project
- ESP8266 Reference Project