00:00:00 callbackif 4 once-3   // check sensor 4, trigger once
//00:00:00 callbackifgap 4 3
00:00:00 track 0 stop
00:00:00 aux 0 off 
00:00:00 program 0 stop
00:00:00 callbackif 4 end

00:00:00 callbackifnot 3 once-3  // check sensor 3 off, trigger once
//00:00:00 callbackifnotgap 3 2
//00:00:00 track 2 forward
00:00:00 sense 2 if  
00:00:00 track 1 forward-100
00:00:00 sense 2 else
00:00:00 track 32 reverse-50
00:00:00 sense 2 end 
00:00:00 callbackifnot 3 end

00:00:00 callbackif 9 repeat  // check sensor 9, trigger continuously
00:00:00 callbackif 9 ignore
00:00:00 track 1 stop
00:00:00 callbackif 9 end

00:00:00 callback 20 repeat  // trigger continuously
00:00:00 callback 20 ignore
00:00:00 track 1 stop
00:00:00 callback 20 end


00:00:05 track 3 forward-100 //test command
00:00:05 track 5 reverse-50 //test command 2
00:00:05 callbackifnotgap 3 1
00:00:08 track 5 5-inc 
00:00:15 track 7 stop    //test command 3
00:00:15 callbackifnotcount 3 repeat // reset counter 
00:00:15 callbackgap 20 3
00:00:17 track 0 stop    //stop all tracks
00:00:18 aux 0 on       //turn all auxiliaries on
00:00:18 callback 20 ignore

00:00:19 pwm 0 0
00:00:19 pwm 8 125
00:00:19 callback 0 ignore   // disable only non conditional callbacks
00:00:19 sense 3 if  
00:00:19 track 2 forward
//00:00:19 callbackifnotgap 3 1
00:00:19 sense 3 ignore  
00:00:19 trackstaterev 6 if  
00:00:19 track 2 stop     
00:00:19 trackstaterev 6 end  
00:00:19 sense 3 else
00:00:19 track 2 reverse  
00:00:19 aux 2 off
00:00:19 sense 3 end  
00:00:19 callbackcount 20 once-2
//00:00:21 callbackcount 21 once-2

00:00:20 analogread 15 if-200-300
00:00:20 track 2 stop   
00:00:20 analogread 15 end
00:00:20 analogread 14 if->-300
00:00:20 track 2 stop   
00:00:20 analogread 14 end

00:00:21 sense 4 ifnot  
00:00:21 track 2 stop   
00:00:21 callbackifnotexp 3 if
00:00:21 track 5 reverse
00:00:21 callbackifnotexp 3 else
00:00:21 track 5 forward
00:00:21 callbackifnotexp 3 end
00:00:21 sense 4 end  
00:00:21 callbackif 3 restore
00:00:21 callback 20 restore
00:00:21 callbackexp 20 ifnot
//00:00:21 callbackexp 20 ifnot
00:00:21 track 2 forward   
00:00:21 callbackexp 20 end

00:00:22 callbackifnot 0 restore
00:00:22 sense 4 ignore
00:00:22 callback 20 execute-force

00:00:23 sense 4 if  
00:00:23 track 2 stop     
00:00:23 sense 4 end  
00:00:23 callback 20 execute

00:00:23 trackstate 6 if  
00:00:23 track 2 stop     
00:00:23 trackstate 6 end  

00:00:23 auxstate 5 if  
00:00:23 track 3 stop     
00:00:23 auxstate 5 end  

00:00:24 sense 4 restore   
    