Jump to content
C4 Forums | Control4

Programming help?


drro

Recommended Posts

Hi, everyone. I'm new to the forums, and new to programming using HE. Here's what I'd like to do: create a button on a six-button keypad in the master bedroom that would check the current source on the living room TV, and turn on the master bedroom tv to the same source. The idea is that as we move from the living room to the bedroom at night, one button press would enable us to continue watching whatever we were watching in the living room. Suggestions (with newbie detail, please), would be greatly appreciated.

Best regards,

David

Link to comment
Share on other sites


In getting to use the software you have to get used to thinking in a certain way.

Identifying the event for an action is probably the first part. In your case the first part should be:

When button 1 is pressed on master bedroom 3 button keypad

the next part is defining the action that will occur when the button press even occurs minimizing the lines processed by the director. I will show you in a way that you can apply to basically all types of programming on your system

Logically the first thing to check for is the power state of the Living Room defined by the following lines:

If room living room power is off (criteria)

- Stop (action - there is no need to continue with the script so the evaluation stops here)

If room living room power is on (criteria)

- (additional lines to be evaluated)

Next you go on to write the criteria for the actions to be taked nested under "if Living room is on" I will do just one example here with the action to occur in master.

If living is on (criteria)

- If Living room video source is Cable (criteria)

- Select the Cable as the video source in Master (action - located under the room in

composer)

- Stop (action - located under programming control)

- If Living room video source is ***** (continue as above until you cover all sources)

Hopefully this gives you a good enough idea to figure things out. It may not be exact in the wording of the events and actions but you should be able to figure it out from this.

Best of luck.

Link to comment
Share on other sites

I personally prefer to use a STRING VAR to keep track of which source is currently playing. Then call upon that variable in your script. That way, you can use the information on other scripts without having to rewrite code.

Link to comment
Share on other sites

Geoff, thanks so much. That worked perfectly, and it would not have been intuitive to me at all. Can I buy you a cup of coffee next week in Vegas?

Best regards,

David

Sure thing. I am there tomorrow send me an e-mail when you are there.

Link to comment
Share on other sites

Thanks, Controlfouruserguy. Can you explain STRING VAR in newbie terms? I appreciate the help.

Best regards,

David

(String) variable allows you to keep track of what source is playing in a given room. Additionally, you can just use plain english to assign to each source. If you aren't planning on using source variables anywhere else in programming you could probably forget this step. I call on these variables for three different tasks so it really helps with programming housingkeeping and eliminates duplication.

Go into the variables agent to find this.

Link to comment
Share on other sites

I personally prefer to use a STRING VAR to keep track of which source is currently playing. Then call upon that variable in your script. That way, you can use the information on other scripts without having to rewrite code.

I do this as well. Very helpful for me.

Link to comment
Share on other sites

Geoff, thanks so much. That worked perfectly, and it would not have been intuitive to me at all. Can I buy you a cup of coffee next week in Vegas?

Best regards,

David

Of course this was the tip-off that he doesn't have that problem. Helps to comprehend what I read...

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.