Jump to content
C4 Forums | Control4

Programming Flashing Lights


byronomo

Recommended Posts

Is there a way to do the following using Composer HE without creating a loop?

Anytime a certain door (with C4 contact) is opened, flash a certain light on/off until the door is closed. Then return that light to the state that it was in before the door was opened.

If so, any guidance would be appreciated.

Thanks!

Link to comment
Share on other sites


Loop? I'm not aware of any "loop" command within CHE. Set-up a repeating timer. Watch the door and start the timer based on door state. Upon expiration of timer, re-evaluate door state and make a decision to stop timer and resume last known setting (use a variable to track light level, that is if variables works for you) or execute a Programming Control STOP.

Your flash interval won't be exact as the processor has to prioritize operations but I've done 0.5Hz with good results.

Link to comment
Share on other sites

Set-up a repeating timer.

Thank you for your response. I'm fairly new at this, so I apologize if my question is a bit basic.....Does a repeating timer basically keep running in the background? If so, does this affect controller performance?

Link to comment
Share on other sites

Main reasons:

1) Really easy to hang Director if you don't get the loop right

2) With timers available, there aren't many programming situations where loop is needed.

I have loops available in ComposerPro, and a fairly extensive project, and I don't believe I have *any* programming that uses the loop construct.

RyanE

Link to comment
Share on other sites

Main reasons:

1) Really easy to hang Director if you don't get the loop right

2) With timers available, there aren't many programming situations where loop is needed.

I have loops available in ComposerPro, and a fairly extensive project, and I don't believe I have *any* programming that uses the loop construct.

RyanE

Tx Ryan. That makes sense. My dealer programmed a couple of loops in my project for my alar

Sensor state - once a door is opened an announcement plays til the alarm is turned off. I thought this was normal.

Link to comment
Share on other sites

I agree with the consensus that timers is the way to go here.

Timers are slick. Before timers came along it was a PITA.

.....Does a repeating timer basically keep running in the background? If so, does this affect controller performance?

Link to comment
Share on other sites

I agree with the consensus that timers is the way to go here.

Timers are slick. Before timers came along it was a PITA.

.....Does a repeating timer basically keep running in the background? If so' date=' does this affect controller performance?[/quote']

It does if you select the REPEATING tick box. I have run several (meaning four) timers simultaneously with no detectable issues.

Link to comment
Share on other sites

.....Does a repeating timer basically keep running in the background? If so' date=' does this affect controller performance?[/quote']

This is why you issue the Programming Control STOP so the timer won't continue to run needlessly.

The Programming Control 'STOP' does not stop a timer. There is a timer command to stop the timer.

Timers can be repeating or not. A non-repeating timer will not keep running in the background. It will fire once (when the timer expires), and then never again unless you start the timer again.

A repeating timer runs and fires every time the time expires, and then resets and starts itself over.

There's not many resources used, and it should not affect controller performance unless you do something stupid, like make a *very short* repeating timer, and in the 'when Timer Expires event', put quite a bit of Control4 programming.

If you were to do this, you could swamp the controller, slowing it down.

RyanE

Link to comment
Share on other sites

The Programmed STOP is to keep the timer going.

I still don't know what you're talking about. Unless you're referring to specific code that has a timer stop after a programming command STOP, the one thing has nothing to do with the other.

RyanE

Link to comment
Share on other sites

(PROGRAM LEVEL for DOOR CONTACT)

If Door State CLOSED

STOP

START Timer X

(PROGRAM LEVEL for TIMER)

TIMER X EXPIRES

If Door State CLOSED

STOP Timer X

The last part of the above example can be coded two ways. The way I showed it you are right- no need for Programmed STOP. But if it is written the inverse way it looks like this-

(PROGRAM LEVEL for TIMER)

TIMER X EXPIRES

If Door State OPEN

STOP

At any rate, I don't see where this type of feature is difficult to program as long as one has some idea where the programming features are within CHE. I'm out.

Link to comment
Share on other sites

Loop? I'm not aware of any "loop" command within CHE. Set-up a repeating timer. Watch the door and start the timer based on door state. Upon expiration of timer, re-evaluate door state and make a decision to stop timer and resume last known setting (use a variable to track light level, that is if variables works for you) or execute a Programming Control STOP.

Your flash interval won't be exact as the processor has to prioritize operations but I've done 0.5Hz with good results.

Might you be able to provide an example of how this can be done in ComposerHE? I keep trying but my controller gets bogged down (presumably from the repeating timer, but I don't know for sure).

Thanks!

Link to comment
Share on other sites

  • 2 months later...

Is there an easy way to make LEDs on a light blink a certain color for a certain state (ie I have my outdoors speakers on) to remind me that a certain event is happening (in this case to remind me to turn off the outdoors speakers before going to bed)?

Could I use a timer, checked as repeating, and just stop that timer when I turn off the speakers?

Link to comment
Share on other sites

^That's what I do. I have a powder room with two distictive color themes in it. I alternate the ON LED to those two colors every five seconds. Hey, I know I'm ghey, that's why I automate my toilet. You might want to do a reset then a stop if your timer is long in duration. That gives you a smooth pattern for the first cycle.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.