fdastoor Posted December 20, 2008 Share Posted December 20, 2008 I would like a switch in the Fam room upstairs to turn on and off a theatre downstairs with a double and triple tap.I know how to program the multiple taps using a 'number' variable.The double tap works in turning on the theater.The triple tap does not execute.I have tried to use a Stop and Break commands between the two parts of the script but it does not work.Can someone please help? Link to comment Share on other sites More sharing options...
henniae Posted December 20, 2008 Share Posted December 20, 2008 Please post your code. Link to comment Share on other sites More sharing options...
fdastoor Posted December 20, 2008 Author Share Posted December 20, 2008 When Light Bottom Button PushedVariables> Double Tap = Variables>DoubleTap + 1When Light Bottom Button is ReleasedDelay 500 millisecondsIf Variables>Double Tap=2 Send Command 'Control4 to TheaterVariables>Double Tap=0StopDelay 500 millisecondsIf Variables>Double Tap=3 Turn of TheaterVariables>Double Tap=0 Link to comment Share on other sites More sharing options...
mjtoopes Posted December 20, 2008 Share Posted December 20, 2008 Dont do your execution on the release... instead, put your code under the variable and include a 1 or 2 second delay.When bottom button is pushedVariables> doubletap = doubletap +1When variables doubletap changesDelay 1 secondIf Variables>Double Tap=2 Send Command 'Control4 to TheaterIf Variables>Double Tap=3 Turn off TheaterVariables>Double Tap=0 Link to comment Share on other sites More sharing options...
slemay Posted December 20, 2008 Share Posted December 20, 2008 When Light Bottom Button PushedDelay 500 millisecondsIf Variables>Double Tap=2 Send Command 'Control4 to TheaterVariables>Double Tap=0StopDelay 500 millisecondsIf Variables>Double Tap=3 Turn of TheaterVariables>Double Tap=0Problem is you're not in the sub-loop for the STOP command. It should look like this:If Variables>Double Tap=2 Send Command 'Control4 to Theater Variables>Double Tap=0 StopIf Variables>Double Tap=3 Turn of Theater Variables>Double Tap=0 StopThe way you have it - if the double tap doesn't = 2 it still sets the variable to 0 and then stops - so it never gets to comparing the double tap 3 parameter. Link to comment Share on other sites More sharing options...
slemay Posted December 20, 2008 Share Posted December 20, 2008 Dont do your execution on the release... instead, put your code under the variable and include a 1 or 2 second delay.Though there are many ways to do everything, the example he used (and I fixed) is the "BEST PRACTICE" way that has been show to dealers in various classes. Link to comment Share on other sites More sharing options...
mjtoopes Posted December 20, 2008 Share Posted December 20, 2008 Dont do your execution on the release... instead' date=' put your code under the variable and include a 1 or 2 second delay.[/quote']Though there are many ways to do everything, the example he used (and I fixed) is the "BEST PRACTICE" way that has been show to dealers in various classes.Even though C4 teaches this, I still think that doing the execution under the variable works the best. I've never had any problem doing that way. To each their own, but I will continue to do what works best. Link to comment Share on other sites More sharing options...
jbs Posted December 21, 2008 Share Posted December 21, 2008 Slemay, any idea why the official best practice is to put the programming in the button instead of in the variable? I've been trying to move more of my prorgamming into variables just to make it 1) easier to find and 2) easier to execute from multiple places. In the situation above, for example, having all the programming in the doubletap variable would mean that executing it from another switch would just involve adding a single line of code to the second place I want to use it, instead of having to recreate the whole program.Is there an advantage to putting it in the light switch?--Jason Link to comment Share on other sites More sharing options...
trippinbillies41 Posted December 22, 2008 Share Posted December 22, 2008 Dont do your execution on the release... instead' date=' put your code under the variable and include a 1 or 2 second delay.[/quote']Though there are many ways to do everything, the example he used (and I fixed) is the "BEST PRACTICE" way that has been show to dealers in various classes.Even though C4 teaches this, I still think that doing the execution under the variable works the best. I've never had any problem doing that way. To each their own, but I will continue to do what works best.Matt's way definitely works. I had the same issue as the OP, and had code exactly like Slemay's that wouldn't work. It looks good on paper, but doesn't execute. Matt's works perfectly. Link to comment Share on other sites More sharing options...
slemay Posted December 25, 2008 Share Posted December 25, 2008 Trip - must be something else in your programming that's wrong - I've done it "my" way 100's of times now and NEVER had an issue yet.Jason & Matt - yes... as I stated - there are multiple ways to do it - and no way is better than the other. I can agree that if I have to call the program from multiple locations, it makes more sense to put it on the variable. In our case - we may use double taps on a bunch of keypads around the house and to keep clutter down in the programming - we use the same variable between all of them (what are the chances that two people in 500 ms are going to be double tapping at the same time???). Plus - I find it easier to find programming on the lights themselves then to go back and check it a variable.But - I think the real lesson here is find a method that works for you and stick with it! Don't use both! As a year or two from now, you come back to that program, you won't remember where or what or even HOW you did something.Good luck!Shawn Link to comment Share on other sites More sharing options...
trippinbillies41 Posted December 28, 2008 Share Posted December 28, 2008 I don't think so man, I know I had done it that way previously as well, and for whatever reason it would work this time. if you'll recall, I even posted screen shots to prove that my code was literally exactly the same as yours, and I still couldn't get it to work.Not saying that you're wrong, because as i said, i swear I had previously programmed systems like that, it just didn't work this time around Link to comment Share on other sites More sharing options...
CFUG Posted February 2, 2009 Share Posted February 2, 2009 I know, eyerolling question here but where is the operation +1 located to increment the variable? Sorry, new at this and still fumbling arouind! I can find = Ok and set a variable equal to something... Link to comment Share on other sites More sharing options...
dogdvr Posted February 2, 2009 Share Posted February 2, 2009 After you set up your variable,GO to the programming tab and highlight the button of choice.select on presson the right hand side of the screen scroll down to variable and select your variablebelow set to valueis set to randombelow that is dropdown box that will allow you to select +select that one Link to comment Share on other sites More sharing options...
CFUG Posted February 2, 2009 Share Posted February 2, 2009 ^Many thanks! This will certainly be useful for me. Link to comment Share on other sites More sharing options...
bjeff Posted February 2, 2009 Share Posted February 2, 2009 I think the reason you see people not program under the variable, is they don't spend much time on it until Tech II. Link to comment Share on other sites More sharing options...
CFUG Posted February 3, 2009 Share Posted February 3, 2009 I must be drain bamaged, I can't get this function to work as described (by slemay) at all. Would be nice if I could check the value of the variable as I go. Link to comment Share on other sites More sharing options...
dogdvr Posted February 3, 2009 Share Posted February 3, 2009 You will have to post your code,Make sure you show us the indents Link to comment Share on other sites More sharing options...
CFUG Posted February 3, 2009 Share Posted February 3, 2009 ^dogdvr- I think this is where I'm having probs. Using MacBook with Bootcamp and 3rd party utility for right-click mouse. I can't get that indent function to work so basically it's blowing past the "if" statement and going straight to the first executable line of code and then stopping. No further comparing of the var. past the first stop. Not at the computer with CHE installed otherwise I'd do th escreenshot for you. I really appreciate your responding to me and sorry for sorta highjacking you fdastoor! Link to comment Share on other sites More sharing options...
dogdvr Posted February 3, 2009 Share Posted February 3, 2009 I am no mac user but can you not drag and drop?If so drag it over ontop of the if command Link to comment Share on other sites More sharing options...
CFUG Posted February 3, 2009 Share Posted February 3, 2009 Tried that, it places the new command one line above that. I wonder if it makes a diff if cursor is ontop of the ? or on the body of the if statement? Link to comment Share on other sites More sharing options...
thecodeman Posted February 3, 2009 Share Posted February 3, 2009 You have to wait for the arrow to change from up arrow to pointing to the right. You dont use a right click, at least I dont. Link to comment Share on other sites More sharing options...
CFUG Posted February 3, 2009 Share Posted February 3, 2009 Yep, just edited my last post asking about that! Thanks again guys Link to comment Share on other sites More sharing options...
slemay Posted February 3, 2009 Share Posted February 3, 2009 If it still doesn't work for you - post a screen shot of your code and we'll tell you where you're going wrong! Link to comment Share on other sites More sharing options...
demcontrol4 Posted February 3, 2009 Share Posted February 3, 2009 There have been so many posts regarding double and triple taps as well as hold commands. It is such a popular command why dont they just make a standard programming tool for this? It seems just adding to the standard press and release commands for programming there could be a radio button for a double tap or hold function. I would think this would make it easier for everybody.....? It just seems like this could be done with a standard built in functionality. Since my house has 70+ switches and keypads I think my dealer spent more time programming holds and multiple taps then anything else. Is there a plan to make a change like this to composer? And if so that would be great to have in the home version to make quick changes. Link to comment Share on other sites More sharing options...
dogdvr Posted February 3, 2009 Share Posted February 3, 2009 While, I can see your point, what do you want the program to do?Double tap on the Garage = whatDouble tap ont the Kitchen = Whattriple tap = what????I hope you see what I mean, if you want flexiblilty you need to have some hard programmingBrent Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.