2 inputs 2 ON/OFF outputs + one output with delayed

68 views
Skip to first unread message

guyc

unread,
Aug 21, 2016, 4:04:42 PM8/21/16
to souliss
For a common air extraction system I detect on 2 places if there is a light on.
From the moment there is one light on, the fan has to start.
When both lights are off, the fan has to run for another X-time before he stops.

the fan is ON when one of the lights is on,    OK
but when both lights are off, the fan stays ON for ever

I made this sketch :

FAST_110ms() 
{
// ventilatie WC/douche

if((mOutput(WC) ==1) || (mOutput(douche)==1)) // verlichting douche of WC aan
     {
     mInput(ventilator_WC)=Souliss_T1n_OnCmd;
     Logic_SimpleLight(ventilator_WC);
     Serial.println(mOutput(ventilator_WC));
     DigOut(45, Souliss_T1n_Coil, ventilator_WC);// ventilator WC

     }
           
else if((mOutput(WC) ==0) && (mOutput(douche) ==0)) // verlichting douche en WC zijn uitgeschakeld
     {
      mInput(ventilator_WC)=Souliss_T1n_Timed;
     //mInput(ventilator_WC)=Souliss_T1n_OffCmd;
     Logic_SimpleLight(ventilator_WC);
     Serial.println(mOutput(ventilator_WC));
     DigOut(45,Souliss_T1n_Coil, ventilator_WC);
   
    }
}

EXECUTESLOW()   {
   SLOW_10s()          
    {
   Timer_SimpleLight(ventilator_WC) ;
    }
}



Di Maio, Dario

unread,
Aug 22, 2016, 4:31:19 PM8/22/16
to sou...@googlegroups.com
Your code looks ok, print the mInput of the ventilator_WC and see what's there.

Dario.

--
You received this message because you are subscribed to the Google Groups "souliss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to souliss+unsubscribe@googlegroups.com.
To post to this group, send email to sou...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/souliss/d797198b-87fe-4999-8455-15a275d43e74%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

guyc

unread,
Aug 23, 2016, 6:21:55 AM8/23/16
to souliss
Dario,

many thanks already for your support
The code gives no errors, but it does not do what I want.

What I need is :
- when one of the the 2 lights or both (WC, douche) are ON, the fan (ventilator_WC)  is also ON.
- when the last light goes OFF, a timer has to start to keep the fan ON for X time.

In my code, the fan is flipping between ON and OFF at the moment the 2 light are OFF.

I have one some way to detect the change of status when the last light goes OFF, but don't know how to do it

Op maandag 22 augustus 2016 22:31:19 UTC+2 schreef Dario Di Maio:
To unsubscribe from this group and stop receiving emails from it, send an email to souliss+u...@googlegroups.com.

Di Maio, Dario

unread,
Aug 23, 2016, 8:36:06 AM8/23/16
to sou...@googlegroups.com

Your code looks ok, that's why I say to print that variable.

Dario.

From Mobile.

To unsubscribe from this group and stop receiving emails from it, send an email to souliss+unsubscribe@googlegroups.com.

To post to this group, send email to sou...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages