program test { #include #include #include #include var vRotHand = 0 var vRotArm = 0 sensor rotation1 on 1 rotation1 is rotation as angle sensor rotation2 on 2 rotation2 is rotation as angle main { ext InterfaceType "kFreestyle" rcx_ClearTimers bbs_GlobalReset([A B C]) try { vRotHand += 0 vRotArm += 0 rcx_Calibrate(4,3) clear Rotation1 clear Rotation2 clear Timer1 display rotation1 } retry on fail try { forever { if rotation1 = (vRotHand / 10){ if rotation2 = (vRotArm / 10){ } else { display rotation2 if rotation2 is -12..12{ } else { bb_PlayNote( 1245, 20, 20 ) } vRotArm = (rotation2*10) } } else { display rotation1 if rotation1 is -450..435{ } else { bb_PlayNote( 2489, 20, 20 ) } vRotHand = (rotation1*10) } } } retry on fail } }