In regards to 599_Competition_Scripting_Template:
Suppose you want to combine two script steps into one and run them simultaneously. Here is a sample script that moves a distance and has a 2 second timeout in case the move doesn’t finish.
void Script_name_1()
{
switch(step)
{
case 1:
int done1= Move_dist_ch1(300, 50); //command a rate of pwm 50 and move to dist1 = 300
int done2=Ms_timer_T1(2000) ; // waits 2 seconds before done
done = (done1>0 || done2>0) ; // Sets done = 1 when either done1 or done2 is completed else o.
break;
default:
Reset_scripts();
}
}
done = (done1>0 || done2>0) is equivalent to the following if test and is easier.
if(done1>0 || done2>0)
{done = 1;}
else
{done = 0;}
We had trouble with this method in the past because we did not set done = 0 as the default. This was normally set to zero by the utility function returning a zero. E.g. done = Move_dist_ch1(..) .
Changing this to done1 = Move_dist_ch1(..) did not reset done = 0 so we have make sure to use the above coding.
I really enjoyed the navigational experience. As I have already been searching across the internet, I can see
that I need to utilize something apart from Tumblr.
Thanks a lot for the attention opening experience