variables defined

Do you have a question on how to do something.
Ask in here.
Post Reply
rossbryant1956
Posts: 471
Joined: Sat Jan 14, 2012 2:08 pm
Location: Montgomery Village, MD

variables defined

Post by rossbryant1956 »

working with this bit of code:

Code: Select all

void StandardHeater2(byte HeaterRelay, int LowTemp, int HighTemp)
{
    if (ReefAngel.Params.Temp[T2_PROBE] == 0) return;  // Don't turn the heater on if the temp is reading 0
    if (ReefAngel.Params.Temp[T2_PROBE] <= LowTemp && ReefAngel.Params.Temp[T2_PROBE] > 0) ReefAngel.Relay.On(HeaterRelay);  // If sensor temperature <= LowTemp - turn on heater
    if (ReefAngel.Params.Temp[T2_PROBE] >= HighTemp) ReefAngel.Relay.Off(HeaterRelay);  // If sensor temperature >= HighTemp - turn off heater
where are those three variables defined; I imagine HeaterRelay is the port where the StandardHeater2 is plugged in, LowTemp and HighTemp are what they seem; but can't find where the original coder defined those variables.

He does have this snippet in the loop section, is this it?

Code: Select all

StandardHeater2( Box1_Port6,776,780 ); //SumpHeater
Thx in advance.
Roscoe's Reefs - Starting Over Again:

Building new 29g Nano after landlord went berserk over my 4 75 gallon tanks, Multiple RA's, Water mixing stations, etc. Your help welcomed in remembering all I've forgotten.
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

variables defined

Post by lnevo »

Probably as globals. Do you have a link to the coders full pde?

You can declare them above the setup() function.

Edit... Sorry just reread what was written... The variables are seclared as part of the function definition...

So when you say

void StandardHeater2(byte heaterrelay, int lowtemp, int hightemp)

Thats where the variables are declared...

When you call the function

StandardHeater2(Box1_Port6, 776, 780)

The variables get assigned...
rossbryant1956
Posts: 471
Joined: Sat Jan 14, 2012 2:08 pm
Location: Montgomery Village, MD

Re: variables defined

Post by rossbryant1956 »

Thanks, very helpful.
Roscoe's Reefs - Starting Over Again:

Building new 29g Nano after landlord went berserk over my 4 75 gallon tanks, Multiple RA's, Water mixing stations, etc. Your help welcomed in remembering all I've forgotten.
Post Reply