Pointer and integer comparison

I am trying to compare a temperature to a dew point so I can regulate a heater. The temperature is labelled OTA (another is EP) and the dew point ((DHT11.dewPointFast()*1.8+34)), DEC). On compile I get an error stating that I can’t compare a pointer to an integer. The location of the issue is near the end of the code. Help?

#include <OneWire.h>
#include <DallasTemperature.h>
#include <LiquidCrystal.h>
#include <dht11.h>
#include <math.h>


LiquidCrystal lcd(7, 8, 9, 10, 11, 12);
dht11 DHT11;

#define ONE_WIRE_BUS 3
#define DHT11PIN 2

OneWire oneWire(ONE_WIRE_BUS);

DallasTemperature sensors(&oneWire);

DeviceAddress OTA={0x28, 0x94, 0xBB, 0x60, 0x03, 0x00, 0x00, 0x38};
DeviceAddress EP={0x28, 0xFE, 0xF6, 0xB6, 0x03, 0x00, 0x00, 0x39};

void setup(void)

{
  sensors.begin();
sensors.setResolution(OTA, 10);
sensors.setResolution(EP, 10);

lcd.begin(16,2);
lcd.clear();

pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
}



void printTemperature(DeviceAddress deviceAddress)
{
float tempC = sensors.getTempC(deviceAddress);
if (tempC == -127.00) {
lcd.print("XX");
} else {
lcd.print((int)(DallasTemperature::toFahrenheit(tempC)));
}
}



void loop(void)

  {
//Serial.println("\n");
int chk = DHT11.read(DHT11PIN);
//Serial.print("Read sensor: ");
switch (chk)
{
case 0: Serial.println("OK"); break;
case -1: Serial.println("Checksum error"); break;
case -2: Serial.println("Time out error"); break;
default: Serial.println("Unknown error"); break;
}
 
delay(1000);


//Lcd display for ambient temp, humidity and dew point on line 1.  Remote temps for OTA and EP on line 2.
lcd.setCursor(0,0);
lcd.print("T");
lcd.print((int)DHT11.fahrenheit(), DEC);
lcd.setCursor(5,0);
lcd.print("H");
lcd.print((int)((float)DHT11.humidity), DEC);
lcd.print("%");
lcd.setCursor(10,0);
lcd.print("Dew");
lcd.print((int)((DHT11.dewPointFast()*1.8+32)), DEC);

sensors.requestTemperatures();
lcd.setCursor(0,1);
lcd.print("OTA ");
printTemperature(OTA);
lcd.print(" ");
lcd.setCursor(9,1);
lcd.print("EP ");
printTemperature(EP);
lcd.print(" ");


//Compare OTA and EP temp to Dew Point Temp.  If the temps are less than 2 degrees above dew point, turn on the heaters on pins 5 and 6
{
if (OTA <= ((int)((DHT11.dewPointFast()*1.8+34)), DEC))
{
  digitalWrite(5, HIGH); //if eyepiece temp is equal to or less than the dew point plus 2 degrees turn pin 5 on
}
else 
{
  digitalWrite(5, LOW); //if eyepiece tep is greater than the dew point plus 2 degrees turn pin 6 off
}
}
{
if (EP <= ((int)((DHT11.dewPointFast()*1.8+34)), DEC)) 
{
  digitalWrite(6, HIGH); //if eyepiece temp is equal to or less than the dew point plus 2 degrees turn pin 6 on
}
else 
{
  digitalWrite(6, LOW); //if eyepiece temp is greater than the dew point plus 2 degrees turn pin 6 off
}
}

delay(1000);

  }

The lines:

if (OTA <= ((int)((DHT11.dewPointFast()*1.8+34)), DEC))
...
if (EP <= ((int)((DHT11.dewPointFast()*1.8+34)), DEC))

don’t make sense and I think are the cause of the problem. What are you trying to do in those lines? In particular, what is the “, DEC” for?

The OTA and EP are the DallasOneWire senors. The ((DHT11.dewPointFast()*1.8+34)) is the DHT11 dew point calculation I want to compare to, converted to farenheit + 2 degrees. I converted to integer for the LCD. Not sure what the 'DEC' is for, but the sample for the DHT11 had it, so I kept it.

Ultimately, I just want to compare OTA/EP to dewPointFast+2 degrees.

How do you compare {0x28, 0x94, 0xBB, 0x60, 0x03, 0x00, 0x00, 0x38} to an int?

By the way, DEC is #defined as 10, so that code is just asking if {0x28, 0x94, 0xBB, 0x60, 0x03, 0x00, 0x00, 0x38} <= 10. Since they’re both constants, I fail to see how that’s useful (assuming it was possible)

Where you are getting the dht11 library from? I can't find the definition of dewPointFast in the versions I found.

https://www.virtuabotix.com/feed/?p=239 That is where I got the library for the DHT11, it has dewPoint and dewPointFast.

As for the addresses, the code doesn't compare the addresses but the temp returned from the addresses, I think. Earlier in the code I use OTA when calling the information to be printed to the LCD: printTemperature, (OTA); I thought I could use the OTA definition as a comparator definition.

As for the addresses, the code doesn’t compare the addresses but the temp returned from the addresses, I think.

Think again.

if (OTA <= ((int)((DHT11.dewPointFast()*1.8+34)), DEC))

where DeviceAddress OTA={0x28, 0x94, 0xBB, 0x60, 0x03, 0x00, 0x00, 0x38};

mitaccio:
https://www.virtuabotix.com/feed/?p=239 That is where I got the library for the DHT11, it has dewPoint and dewPointFast.

As for the addresses, the code doesn’t compare the addresses but the temp returned from the addresses, I think. Earlier in the code I use OTA when calling the information to be printed to the LCD: printTemperature, (OTA); I thought I could use the OTA definition as a comparator definition.

What you need is something like this:

if (eyepieceTemp <= ((int)(DHT11.dewPointFast()*1.8+34))

where eyepieceTemp is a temperature reading in deg F from one of your temp sensors.

So how do I define the OTA/EP temps so that I can compare them against the dewPointFast? Can you using my code show me? I am an uber-noob with no formal training and very little experience. Just a cut and paster.

Something like: float tempC = sensors.getTempC(deviceAddress); ?

I have been working on this for a week now and still haven’t been able to resolve this using the above mentioned help. Uber-noob here.
In this line of code if (OTA <= ((DHT11.dewPointFast()*1.8+34))) I need to change the (OTA) to be a reference to the temp already called earlier in the code. I assume it needs to be like this:

if (somethingTemperature (OTA) <= ((DHT11.dewPointFast()*1.8+34)))

but I am not sure what that something should be. Any guidance? Suggestions on better ways to fix this?

I need to change the (OTA) to be a reference to the temp already called earlier in the code. I assume it needs to be like this:

Not even close.

Think about what you are trying to do. Think about what this bit of code does:

DHT11.dewPointFast()*1.8+34

It calls a method, dewPointFast(), on an object, DHT11. That method returns a value. That value is multiplied by 1.8. Then, 34 is added to the result.

STORE THAT RESULT IN A VARIABLE!!!

Then, later, when you need to do the same thing, store the result in another variable.

Then, it should be fairly easy to see what to compare to see if a change has occurred.