It works but is it being done correctly: multiple DS18B20s 1-Wire Bus

Do you mean: :thinking:


  //**********************************
  temperatureFreezerC = sensors.getTempC(freezerAddress);
  Serial.print( “Freezer temperature is = “); 
  Serial.println( temperatureFreezerC );

  if(temperatureFreezerC >= -5)
  {
       //turn on the horn
       digitalWrite( alarmHorn, hornON );
  }

OK. Just go directly to a specific address request seems to be what you are suggesting. That is
about as straightforward as anything else....

Pretty much so :+1: .


EDIT

How many DS18B20s are on your bus ?

just 3 right now...

Suggest you keep it simple

If the TIMER is expired:
{
Get temp1, get temp2, get temp3.

Start new conversion.

if(temp1 …) { //do something }
if(temp2 …) { //do something }
if(temp3 …) { //do something }
}

I think you are referring to this:

if (millis() - readTempTime >= 2000)
1 Like

You graduated !

1 Like

...at bottom of my class... lol

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.