Arduino Playground is read-only starting December 31st, 2018. For more info please look at this Forum Post

DS7505 Library

Here is a Library for interfacing the Maxim DS7505 Digital Thermometer and Thermostat Sensor. (http://www.maxim-ic.com/datasheet/index.mvp/id/5730/t/al).

I have shared this lib in the launchpad (http://bazaar.launchpad.net/~gnome-sage/%2Bjunk/arduino/files/head%3A/libraries/DS7505/). There you can download the current version and check for updates.

Please feel free to email me with any questions or suggestions for improvements <gnome.sage@gmail.com>.


Example:

// DS7505 
// by Alexandre Coffignal <https://www. ... .com>

// Demonstrates use of the DS7505 library
// Reads data from an I2C/TWI DS7505 slave device

// Created 26 October 2010


#include <Wire.h>
#include <ds7505.h>
DS7505 ds7505 = DS7505();

void setup()
{
  Wire.begin();        // join i2c bus (address optional for master)
  Serial.begin(9600);  // start serial for output
  ds7505.config(7, R12BITS);
}

void loop()
{
  int iTemp = ds7505.getTemp(7);
  //print current Temp in °C
  Serial.print(iTemp/100,DEC);
  Serial.print(".");
  Serial.print(iTemp%100,DEC);
  unsigned int uiReg=ds7505.readReg(7, REG_TEMP);
  Serial.print(" ");
  Serial.print(uiReg);
  //read other registry
  uiReg=ds7505.readReg(7, REG_CONFIG);
  Serial.print(" ");
  Serial.print(uiReg,HEX);
  uiReg=ds7505.readReg(7, REG_THYST);
  Serial.print(" ");
  Serial.print(uiReg);
  uiReg=ds7505.readReg(7, REG_TOS);
  Serial.print(" ");
  Serial.println(uiReg);

  //set Thermostatic Settings 
  ds7505.setTHyst(7, 12345);
  ds7505.setTOS(7, 9876);

  delay(500);

}