Ejemplo n.º 1
0
			/**
			 * \brief	Read the value off the analog channel (convenience function)
			 * 
			 * Blocks until the conversion is done.
			 * 
			 * Equivalent to:
			 * \code
			 * startSingleConversion();
			 * while (!isConversionComplete())
			 *     ;
			 * getResult();
			 * \endcode
			 */
			static uint16_t
			read()
			{
				startSingleConversion();
				while(!isConversionComplete())
					;
				return getResult();
			}
// Continue to check if the IC has responded with a temperature
void DallasTemperature::blockTillConversionComplete(uint8_t bitResolution){
    
    int delms = millisToWaitForConversion(bitResolution);
    if (checkForConversion && !parasite){
        unsigned long now = millis();
        while(!isConversionComplete() && (millis() - delms < now));
    } else {
        delay(delms);
    }
    
}