Error

I am trying to evaluate the and averaged analog input called averagelightLevel with the statement:

if (averagelightLevel >= 600)
(close)

and the message I get is ISO C++ forbids comparison between pointer and integer

What I want to happen is if averagelightLevel is >= 600 execute close

Assuming 'close' is a function, it should be called as:

close();

not:

(close)

In future, and now if that doesn't work you need to post your FULL code. A tiny snippet of code like that is pretty much useless when it comes to trying to debug.

The error seems pretty explicit, but we'd need to see your code.

redneck:

if (averagelightLevel >=  600)

I guess that averagelightLevel is a function and you are trying to compare the return value from the function:

if (averagelightLevel() >=  600)

Of course, I shouldn't have to guess.

PeterH:

redneck:

if (averagelightLevel >=  600)

I guess that averagelightLevel is a function and you are trying to compare the return value from the function:

if (averagelightLevel() >=  600)

Of course, I shouldn't have to guess.

Sorry guys, I read the read me for this catagory and it said something about short and sweet. I am trying to write some code for a automatic chicken door that will open and close depending on the light level and not rely on a real time clock with tables to operate. Please forgive my simple questions, it's my first attempt to program anything beyond a blinking light. Thanks for the help, that was the ticket!

It also said to post your code inside code tags, and to give a meaningful subject line.