Onewire Dallastemperature low and high alarm separate

Johnwasser

You have saved me a lot of time and giving my understanding a serious push in the right direction.
It wasn't so hard after all. No hard brain curling but a few eurekas. I think it was the float part i first saw as difficult :slight_smile:
I found the "requesting temperatures twice" and "reporting" issue you mentioned. Me fooling around with code (trail and... you know)

Well here is how it looks for now:

if (sensors.hasAlarm(Temp1)) {
    float tempC = sensors.getTempC(Temp1);
    if (tempC != DEVICE_DISCONNECTED) {
        if (tempC >= sensors.getHighAlarmTemp(Temp1)) {
          digitalWrite(3, HIGH);  
          // HIGH alarm
       }   
        if (tempC <= sensors.getLowAlarmTemp(Temp1)) {
          digitalWrite(4, HIGH);
        // LOW alarm
        }
    }
}

This i have some trouble understanding if (tempC != DEVICE_DISCONNECTED) {
If tempC not equal to what?

I will do some more modifying and trimming and if it is okay with you, i will run the code by you, when almost done.

And for now - thank you very, very much Johnwasser

Kind regards
Anders (Denmark)