tfmacz
12-11-2007, 01:34 AM
I am note sure if someone has posted this somewhere or not but if they did I never saw it...
This is how I got the background script to loop continuously. It blinks an led that I use as a "Heart Beat" to kick a watchdog timer and to let me know everything is running ok. Actually it blinks 4 channels of which I only use one.
void Start() {
Off(All);
while(true){
On(Channels(Channel_84, Channel_85, Channel_86, Channel_87),For(1).Second, Wait);
Off(Channels(Channel_84, Channel_85, Channel_86, Channel_87),For(1).Second, Wait);
continue;
WaitOnTimers();
}
Off(All);
}
This probably breaks all kinds of programming rules but it works as of 2.0.4.1
The key is the "while/continue". I guess these are C# but I don't do C# so can't say for sure. The program never "tests" anything so it is always true. Probably should set something true to be sure but not sure how to do that??? Also, Watch the extra set of curly brackers.
As always, This is how I did it. Your milage may vary.
This is how I got the background script to loop continuously. It blinks an led that I use as a "Heart Beat" to kick a watchdog timer and to let me know everything is running ok. Actually it blinks 4 channels of which I only use one.
void Start() {
Off(All);
while(true){
On(Channels(Channel_84, Channel_85, Channel_86, Channel_87),For(1).Second, Wait);
Off(Channels(Channel_84, Channel_85, Channel_86, Channel_87),For(1).Second, Wait);
continue;
WaitOnTimers();
}
Off(All);
}
This probably breaks all kinds of programming rules but it works as of 2.0.4.1
The key is the "while/continue". I guess these are C# but I don't do C# so can't say for sure. The program never "tests" anything so it is always true. Probably should set something true to be sure but not sure how to do that??? Also, Watch the extra set of curly brackers.
As always, This is how I did it. Your milage may vary.