DS18B20.read

Name

 * DS18B20.read

Description
Initiates a temperature measurement and reads the result from a DS18B20 device on the 1-wire bus.

If there are multiple devices on the 1-wire bus, then the address of the specific device must already have been set or read into the table of ROM codes by using the DS18B20.find function before this function is used.
 * Since Beta 9.5

Syntax
u8 DS18B20.read(u8 pin, u8 num, u8 resolution, TEMPERATURE * t)
 * Parameters :
 * pin = pin number where one-wire bus is connected.
 * num = index of the sensor or SKIPROM ( = 0 ) if there is only one sensor on the bus.
 * resolution = 9 to 12 bit resolution (RES12BIT, RES11BIT, RES10BIT or RES9BIT)
 * t = temperature pointer


 * Returns/Output :
 * TRUE ( = !FALSE ) if a temperature measurement has been made or FALSE ( = 0 ) if no measurement has been made.
 * the measured temperature in the variable of data type TEMPERATURE identified by the pointer t. The data type definition for data type TEMPERATURE is given below.

typedef struct {    u8  sign;		// sign (1=negative) u8 integer;	// integer part u16 fraction;	// fractional part } TEMPERATURE;