8/25/2009 8:28 PM | |
Posts: 16 Rating: (2) |
I'm trying to write code that expands on the "Controlling_2_Outputs_With_1_Pushbutton.lsc" example I downloaded the other day. I would like to have a counter count the number of times I close the momentary switch and cycle the timer, and therefore the output, that number of times. I have it working now that if I hit the button for less than one second the output will set for 5 sec. I want to add a counter so that if I hit the button 3 times, the output will be set for 15 seconds, hit the button 5 times the output sets for 25 seconds, etc. I can count the hits on a button and set the output, but I'm having trouble figuring out how to decrement the counter each time the timer times out and then get the timer to start again if the counter is still greater than 1. I'm chasing my self in circles trying to figure out how to do that. Currently using an 0BA5 unit. Picture of current circuit attached. Don |
Last edited by: bmwbykrydr at: 9/12/2009 4:36 AMAdded a link to the example that I mention in the post. Last edited by: bmwbykrydr at: 9/1/2009 3:55 PMI uploaded a better picture of the circuit. I realized I had some connectors that had overlapped and made the circuit confusing. This one is much clearer. Last edited by: bmwbykrydr at: 8/26/2009 7:28 PMLast edited by: bmwbykrydr at: 8/26/2009 5:42 PM |
|
9/17/2009 8:53 PM | |
Posts: 16 Rating: (2) |
OK, I think I've got it. Feel free to try it and let me know your thoughts. Don |
Follow us on