ectCode:if (clk("go")) { X++ if (X == 1) {Address = #} if (X == 2) {Address = #} if (X == 3) {Address = #} }
Uh - Why has the highlight gone into one line?
What i am trying to do is to set a timer to go then have 7 comands triger every ten digits of the timer. Each comand needs to happen and then reset to 0 by the time the next one trigers.
Heres what i have;
I want it to goCode:@inputs Address @outputs Active @persist First Second Third Fourth Fith Sixth Enter Time interval(50) if (Active == 1) {timer("go",100) } if (? == 10) {Address==First}
Sadly it wont let me do this. Any help would be awsome.if (Active == 1) {timer("go",100) == Time}
if (Time == 10) {Address == first}
if (Time == 20) {Address == first}
if (Time == 30) {Address == first}
"and so on"
if (Time == 80) {stoptimer("go")}
ectCode:if (clk("go")) { X++ if (X == 1) {Address = #} if (X == 2) {Address = #} if (X == 3) {Address = #} }
Uh - Why has the highlight gone into one line?
Last edited by Whosdr; 02-26-2010 at 03:10 PM.
.siht daer ot gniyrt emit detsaw ev'uoY
Highlight?
Why is it an if statement?
And how do i then make the clk stop?
if (Active == 1)
{
if (clk("go"))
{
Time++
if (Time == 10) {Address = #}
if (Time == 20) {Address = #}
if (Time == 30) {Address = #}
}
Is that right?
Last edited by f33b0; 02-26-2010 at 02:45 PM.
Code:if(!Active) { stoptimer("go") }
Is there any way to reset the timer while it is still running?
stoptimer("")
timer("")
Remember that timer() is basically just interval() with a unique name, so you'll still have to maintain a separate counter variable while the timer triggers executions.Code:@inputs, outputs blah blah blah timer("go", 50) if (Active & clk("go")) { X++ if (X==1){foo} if (X==2){bar} ... if (X == some max number, like 10){stoptimer("go"), timer("go", 50), then foo} }
Last edited by Shizuka; 03-18-2010 at 07:06 PM.
I never got around to using timer() but I would approach it like this:
This makes the E2 execute every 10 seconds. But if you need to do other things as well and this is too slow, you can do this:Code:interval(10000) #Your code
This makes the timer go on forever, and every 10 seconds it will execute. You can add code so that the timer will reset it self after some time.Code:interval(10) #This (I think) is the fastest you can make E2 run normally Timer += 0.1 if ((Timer % 10) == 0) { #Your code }
Bookmarks