I'm using DS18B20 sensor with this library, the 750ms delay is causing problem in timer part of my code. the code below is from DallasTemperature.cpp:
// returns number of milliseconds to wait till conversion is complete (based on IC datasheet)
int16_t DallasTemperature::millisToWaitForConversion(uint8_t bitResolution) {
switch (bitResolution) {
case 9:
return 94;
case 10:
return 188;
case 11:
return 375;
default:
return 750;
}
I'm reading the temperature like this:
#include <OneWire.h>
#include <DallasTemperature.h>
#define ONE_WIRE_BUS A0
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
void setup() {}
void loop () {
float currentTemp = sensors.getTempCByIndex(0);
sensors.requestTemperatures();
}
sensor is not connected in parasite mode, and there is only one sensor.
How can i change the resolution from 12 to 9 bit?