Ds1621
Steven Tron
Posts: 13
Hi,
Recently I've been messing around with I2C devices whilst learning how to program the Javelin, as a result I've written another very·basic I2C device·class. This time it's for the Dallas DS1621 digital thermometer and thermostat IC. As always feel free to suggest improvements.
The class has the following methods defined
DS1621(I2C, Adr, OpMode) is the constructor method where I2C is pointer to an I2C object, Adr is the I2C device address (read) and OpMode = 1 enables One shot temp reading, 0 for continuous temp reading
gettemp() returns temp in C
startconv() & stopconv() starts and stops temp conversion within the IC thus lowering its power consumption
set1shot(boolean) sets one shot mode
setTH(int) & setTL(int) sets thermostat trigger and reset·points. The Tout pin is configured to be active high in this class.
Regards
Steve
Recently I've been messing around with I2C devices whilst learning how to program the Javelin, as a result I've written another very·basic I2C device·class. This time it's for the Dallas DS1621 digital thermometer and thermostat IC. As always feel free to suggest improvements.
The class has the following methods defined
DS1621(I2C, Adr, OpMode) is the constructor method where I2C is pointer to an I2C object, Adr is the I2C device address (read) and OpMode = 1 enables One shot temp reading, 0 for continuous temp reading
gettemp() returns temp in C
startconv() & stopconv() starts and stops temp conversion within the IC thus lowering its power consumption
set1shot(boolean) sets one shot mode
setTH(int) & setTL(int) sets thermostat trigger and reset·points. The Tout pin is configured to be active high in this class.
Regards
Steve
txt
3K