program test { #include #include #include #include var vF_Cnt = 0 var vR_Cnt = 0 sensor rotation1 on 1 rotation1 is rotation as angle event less_rotation1EventLow when rotation1 < -2 sensor rotation2 on 2 rotation2 is rotation as angle event less_rotation2EventLow when rotation2 < -2 main { ext InterfaceType "kFreestyle" rcx_ClearTimers bbs_GlobalReset([A B C]) start RotationWatcher0 start RotationWatcher1 rcx_Priority( 8) trigger less_rotation1EventLow trigger less_rotation2EventLow float [ A B C ] rcx_Calibrate(4,3) clear Rotation1 clear Rotation2 display rotation1 forever { if rotation1 > 1{ rcx_Calibrate(4,1) clear Rotation1 } else { } if rotation2 > 1{ rcx_Calibrate(4,2) clear Rotation2 } else { } } } watcher RotationWatcher0 monitor less_rotation1EventLow { rcx_Priority( 5 ) off [ A ] display rotation1 wait 20 float [ A ] if rotation1 < -6{ wait 20 off [ A ] wait 20 float [ A ] } else { } rcx_Calibrate(4,1) clear Rotation1 } restart on event watcher RotationWatcher1 monitor less_rotation2EventLow { rcx_Priority( 5 ) off [ B ] display rotation2 wait 20 float [ B ] if rotation2 < -6{ wait 20 off [ B ] wait 20 float [ B ] } else { } rcx_Calibrate(4,2) clear Rotation2 } restart on event }