
' FILE : DualVideo_WithCapSensor

' =====================================================================
'  A first video is looping 
'  Moving a hand a second video is presented and moved by the hand
' =====================================================================

' Slot  1 = Cap Sensor      (0 to 1000)
' Slot 10 = Video posistion (0 to 1000)
' Slot 11 = Video Change    (0 to nnn)  (ordinal number of video file in the folder)

Option Speed 7

Label Loop		
   	If Slot(1) < 50
		' ------------------------------ select first Video
		Slot(11) = 0
		' ------------------------------ loop video from 0 to 1000		
		Slot(10) = Slot(10) + 4.3
		If Slot(10) >= 1000
			Slot(10) = 0
		EndIf
	Else
		' ------------------------------ select second Video
		Slot(11) = 1
		' ------------------------------ use CapSensor value to move the video		
		Slot(10) = (Slot(1) - 50) * (1000 / 950) 
	EndIf
	Wait Seconds 0.03	
GoTo Loop
