Skip to content

Spark Core library port of Dallas Temperature Sensor library (MAX31850, DS18B20, DS18S20, DS1822, DS1820)

License

Notifications You must be signed in to change notification settings

TMcGahee/SparkCoreDallasTemperature

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spark Core compatible Dallas Temperature sensor library

This library is a port of the Arduino Dallas Temperature Sensor library. Some includes have been fixed, but the libary is otherwise untouched.

Note: This library depends on the OneWire library, so be sure to include it in your project too.

Original repository by Miles Burton: Arduino-Temperature-Control-Library.

This library supports the following devices:

  • MAX31850 - New!
  • DS18B20
  • DS18S20 - Please note there appears to be an issue with this series.
  • DS1822
  • DS1820

You will need a pull-up resistor of about 5 KOhm between the 1-Wire data line and your 5V power. If you are using the DS18B20, ground pins 1 and 3. The centre pin is the data line '1-wire'.

Example code

!! Make sure to include the libraries !!

// Init Dallas on pin digital pin 3
DallasTemperature dallas(new OneWire(D3));

void setup(){
	Serial.begin(9600);
	dallas.begin();
}

void loop(){
	dallas.requestTemperatures();
    float celsius = dallas.getTempCByIndex( 0 );
    Serial.print("Temperature: "); Serial.println(celsius) ;
}

About

Spark Core library port of Dallas Temperature Sensor library (MAX31850, DS18B20, DS18S20, DS1822, DS1820)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 55.0%
  • Processing 45.0%