Dallas' DS1820 family temperature sensor using mbed debug logs.

Dependencies:   OneWire

Fork of DS1820 by Zoltan Hudak

DS1820.h

Committer:
hudakz
Date:
2015-03-26
Revision:
7:4403a206e78a
Parent:
4:adf4e7972d73
Child:
8:8dfdd1603e4d

File content as of revision 7:4403a206e78a:

#ifndef DS1820_H_
    #define DS1820_H_

    #include <OneWire.h>

class   DS1820
{
    OneWire oneWire;
    uint8_t type_s;
    uint8_t data[12];
    uint8_t addr[8];
    float   toFloat(uint16_t word);
public:
    uint8_t present;

    DS1820(PinName pin);
    DS1820(char model, PinName pin);
    bool   begin(void);
    void   setResolution(uint8_t res);
    void   startConversion(void);
    float  read(void);
};
#endif /* DS1820_H_ */