' Theremino Automation rel 2.8 - program name: MicroViewer.txt
'
' Purpose: An external event to the PC trigger the acquisition of the image using slot 
' and Theremino MicroViewer
'
' Program name: Leo_MicroViewer_0_0.txt
'
'rel 0.0 Start Date: 14 Mar 2015


Option Speed 3 			' IL CURSORE SPEED HA 9 TACCHE - DA 1 a 9 - SPEED VA ANCHE LUI DA 1 A 9

Button 1 Text AVVIO
Button 2 Text PAUSA
Button 3 Text FERMA
Button 4 Text " "      
Button 5 Text " "      

Key 1 GoSub AVVIO      
Key 3 GoTo FERMA       

' Qui looppa in attesa di comandi
Label Loop		
	If Slot(7) > 500   		' al pin 7 c'e' uno switch bistabile connesso a GND
		GoSub AVVIO		' se lo Slot 6 supera il valore 500 viene chiamato AVVIO.	
     EndIf   
GoTo Loop


Label AVVIO 
   	If Slot(8) > 0			     ' se maggiore di 500 acquisici immagine
		Slot(11) = 1000		' Say to MicroViewer Take a shot!   	
		Wait Seconds 0.01		' Per Livio: Qual'e' il tempo  minimo?
		Slot(11) = 0			' Rearm the MicroViewer the sigle shot trigger. 
     	Wait Seconds 0.5	' Per Livio: Qual'e' il valore minimo di attesa prima di poter acquisire una nuova foto?
  	EndIf 
Return
				


Label FERMA
      
Stop			

