Go Down

Topic: Last stage debugging - Help !![SolveD] (Read 3 times) previous topic - next topic

taz3m


This has me curious -

Code: [Select]

oid FanControlOFF()
{
    if ( FanStatus == true )
    {   }

    {
        if ( Actualtemp <= 24.50 )
        {
            digitalWrite(Fan01, LOW);
            FanStatus = false;
        }
    }
}




Curious . . why ??  when conditions for my fan are to be run, i set the flag for Fanstatus to be true, and i use same to get it to shut off along with the temperature reading desired. my simulation with leds do work well.

anything i missed or something you finding suspicious here . .

thanks ..
tz
.....

lloyddean

#6
Mar 03, 2013, 06:29 pm Last Edit: Mar 03, 2013, 06:31 pm by lloyddean Reason: 1
Sorry but my formatting tool screwed that up somewhat.  This is your code -



Code: [Select]

void FanControlOFF()
{
    if (FanStatus == true)
        ;


    {
        if (Actualtemp <=24.50)
        {
            digitalWrite(Fan01,LOW);
            FanStatus = false; 
        }   
    }
}


PaulS

Quote
the delay is just for Serial port viewing for debugging purpose.

That may be the intended use, but delay() doesn't know that. It stops your code from doing anything else, except processing interrupts.

taz3m

Quote

Quote
the delay is just for Serial port viewing for debugging purpose.

That may be the intended use, but delay() doesn't know that. It stops your code from doing anything else, except processing interrupts.


i did remove the delay from the code still, my voltage pin would not flip . .

Say if i change those code lines as such, will that have a contrast in running the whole code. (( Im at my workplace for now, so i cannot test these, i just asking a suggestion))

Code: [Select]

float temperatureRead (){
  if (TempRead == true){
. . . .
}


instead

Code: [Select]

void loop () {
if (TempRead == true){
float temperatureRead (){
. . .
}


and for those as well :
Code: [Select]

void LightAction (){
if (ReadPhoto == true){
. . . .
}

[code]
void () loop {

if (ReadPhoto == true){
     void LightAction (){
. . . . .
}



thanks .  . .[/code]
tz
.....

PaulS

Code: [Select]
void loop () {
if (TempRead == true){
float temperatureRead (){
. . .
}

That won't work. You can't define a function inside a function.

Go Up