# Problem with code

See attatched code.

sketch_apr04a.ino (4.31 KB)

See attatched code.

Why isn't it posted?

Possibly some closing } missing
And == does not belong in `fanSpeed = 0; ==`

Might be more wrong but that is what I picked up.

``````int tempMin = 18.333;   // Minimum temperature to start the fan in celcius
int tempMax = 26.667;   // Maximum temperature to turn fan at 100% speed
``````

Clueless about what int means, I see.

``````   if(tempMax> temp > tempMin)  {  // if temperature is inbetween min and max temp
``````

That is NOT how to check that a value is in a range. There are NO shortcuts.

``````IRrecv irrecv(remote);
decode_results results;
{
void dump(decode_results *results)}
float tf = (t*1.8)+32; //convert Celcius to Farenheit

}
``````

No one else is allowed to define a function inside a function. What makes you special? Nothing.

PaulS:

``````int tempMin = 18.333;   // Minimum temperature to start the fan in celcius
``````

int tempMax = 26.667;   // Maximum temperature to turn fan at 100% speed

``````

Clueless about what int means, I see.

``````

if(tempMax> temp > tempMin)  {  // if temperature is inbetween min and max temp

``````

That is NOT how to check that a value is in a range. There are NO shortcuts.

``````

IRrecv irrecv(remote);
decode_results results;
{
void dump(decode_results results)}
float tf = (t
1.8)+32; //convert Celcius to Farenheit

}

``````

No one else is allowed to define a function inside a function. What makes you special? Nothing.
``````

How would I check if a value is within the range, then? Also, what do you mean by a "function inside a function."

``````    else if(t>=26 && t<29){