@ -79,10 +79,25 @@ uint8_t DS18b20_init()
|
||||
void getall_temp(float *temp)
|
||||
{
|
||||
DS18b20.requestTemperatures(); // Send the command to get temperatures
|
||||
// vTaskDelay(1000);
|
||||
|
||||
for(int8_t i ;i<temp_number;i++)
|
||||
{
|
||||
temp[i] = DS18b20.getTempC(p[i]);
|
||||
// temp[i] = getone_temp(i);
|
||||
uint32_t n = 0;
|
||||
while(temp[i] < -110)
|
||||
{
|
||||
vTaskDelay(100);
|
||||
// temp[i] = DS18b20.getTempC(p[i]);
|
||||
temp[i] = getone_temp(i);
|
||||
n++;
|
||||
if (n>40)
|
||||
{
|
||||
write_log(log_path,"ds18b20 get temperature failed",10);
|
||||
// return;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// write_log(log_path,"get temperatures ok",10);
|
||||
|
||||
Reference in New Issue
Block a user