'       D a n i S C A R A _ H D _ 5 . t x t               1 8   J a n   2 0 1 9 
 
 '   M i c r o S t e p p e r   s t e p p e r   1 / 1 6   s t e p p e r   a s   1 6 0 0   s t e p   f o r   a   m o t o r   r u n 
 
 '   G e a r   r a t i o   1 : 5 0         S t e p   x   d e g r e e   =   1 6 0 0 m i c r o s t e p   x   3 6 0   /   3 6 0   =   5 9 . 5 5 6   f o r   M 1   &   M 2 
 
 '   A x i s   Z     S t e p   x   m m     5 9 . 5 5 6 
 
 
 
 S p e e d   9 
 
 
 
 B u t t o n   1   T e x t   H o m e 
 
 B u t t o n   2   T e x t   H o m i n g _ M 1 
 
 B u t t o n   3   T e x t   H o m i n g _ M 2 
 
 B u t t o n   4   T e x t   H o m i n g _ Z 
 
 B u t t o n   5   T e x t   E n a b l e M o t o r 
 
 B u t t o n   6   T e x t   D i s a b l e M o t o r 
 
 B u t t o n   7   T e x t   D e m o R a n d o m 
 
 B u t t o n   8   T e x t   G o n g 
 
 
 
 L o a d   T h e r e m i n o _ H A L \ T h e r e m i n o _ H A L . e x e 
 
 L o a d   T h e r e m i n o _ H A L \ t h e r e m i n o _ S l o t V i e w e r . e x e 
 
 
 
 K e y   6   	 	 	 G o s u b   K e y O p e n G r i p p e r 
 
 K e y   4   	 	 	 G o s u b   K e y C l o s e G r i p p e r 
 
 K e y   5   	 	 	 G o s u b   F a r F r o m Z e r o 
 
 K e y   R i g h t 	 	 G o s u b   M o v e R i g h t 
 
 K e y   L e f t   	 	 G o s u b   M o v e L e f t 
 
 K e y   U p   	 	 	 G o s u b   M o v e U p 
 
 K e y   D o w n   	 	 G o s u b   M o v e D o w n 
 
 K e y   P a g e u p 	 	 G o s u b   M o v e U p p e r 
 
 K e y   P a g e d o w n 	 G o s u b   M o v e L o w e r 
 
 K e y   P 	 	 	 G o s u b   P u m p 
 
 
 
 S l o t   1 3   =   2 6 0 	 	 	 	 '   o p e n   g r i p p e r 
 
 S t o p 
 
 
 
 L a b e l   G o n g 
 
 	 L o a d   S o u n d \ g o n g . w a v 
 
 R e t u r n 
 
 
 
 
 
 
 
 L a b e l   D e m o R a n d o m 
 
 	 S l o t   1 8   =   1 0 0 0     	 	 '   l i g h t   g r i p p e r   o n 
 
 	 G o s u b   H o m e 
 
 	 S l o t   1 3   =   2 6 0 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 G o s u b   O p e n G r i p p e r 	 	 ' B r e a k p o i n t 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t   3   =   1 2 0 
 
 	 G o s u b   W a i t A l l M o t o r s 	 	 ' B r e a k p o i n t 
 
 	 S l o t   5   =   8 0 	 	 	 	 ' B r e a k p o i n t 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 G o s u b   C l o s e G r i p p e r 
 
 	 S l o t   1   =   1 8 0 	 	 	 ' B r e a k p o i n t 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t   3   =   1 1 5 	 	 	 ' B r e a k p o i n t 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t   5   =   7 0 	 	 	 	 ' B r e a k p o i n t 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 G o s u b   O p e n G r i p p e r 
 
 	 S l o t   1   =   1 6 0 	 	 	 ' B r e a k p o i n t 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t   3   =   1 6 0 	 	 	 ' B r e a k p o i n t 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t   1   =   4 0 	 	 	 	 ' B r e a k p o i n t 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t   5   =   1 2 0 	 	 	 ' B r e a k p o i n t 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 G o s u b   C l o s e G r i p p e r 
 
 	 S l o t   3   =   1 6 5 	 	 	 ' B r e a k p o i n t 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t   1   =   3 1 5 	 	 	 ' B r e a k p o i n t 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t   3   =   1 7 0 	 	 	 ' B r e a k p o i n t 
 
 	 G o s u b   O p e n G r i p p e r 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t   1   =   1 3 5 	 	 	 ' B r e a k p o i n t 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t   3   =   1 6 0 	 	 	 ' B r e a k p o i n t 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t   1   =   7 1 	 	 	 	 ' B r e a k p o i n t 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t   3   =   1 7 5 	 	 	 ' B r e a k p o i n t 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t   5   =   1 0 0 	 	 	 ' B r e a k p o i n t 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 G o s u b   C l o s e G r i p p e r 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t   1   =   3 2 	 	 	 	 ' B r e a k p o i n t 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t   3   =   1 6 0 	 	 	 ' B r e a k p o i n t 
 
 	 G o s u b   O p e n G r i p p e r 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t   1   =   1 7 5 	 	 	 ' B r e a k p o i n t 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t   1   =   3 1 5 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t   5   =   6 0 	 	 	 ' B r e a k p o i n t 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 G o s u b   C l o s e G r i p p e r 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t   3   =   1 7 0 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t   1   =   8 0 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t   3   =   9 0 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t   3   =   1 2 0 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t   1   =   1 7 5 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t   5   =   1 2 0 	 	 	 ' B r e a k p o i n t 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 G o s u b   O p e n G r i p p e r 
 
 	 S l o t   3   =   1 3 5 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t   1   =   1 9 5 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t   3   =   6 0 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 G o s u b   C l o s e G r i p p e r 
 
 	 S l o t   3   =   1 7 5 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t   1   =   1 6 0 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t   3   =   9 0 
 
 	 G o s u b   O p e n G r i p p e r 
 
 	 S l o t   1   =   1 5 5 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t   1   =   3 0 0 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t   3   =   1 6 0 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t   3   =   1 7 0 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t   1   =   9 0 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t   3   =   1 3 5 
 
 	 G o s u b   C l o s e G r i p p e r 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t   1   =   1 6 0 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t   1   =   5 5 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t   3   =   1 7 0 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 G o s u b   O p e n G r i p p e r 
 
 	 S l o t   1   =   1 0 8 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t   3   =   9 0 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t   3   =   1 3 5 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t   1   =   1 8 0 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t   3   =   1 6 5 
 
 	 G o s u b   C l o s e G r i p p e r 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t   1   =   3 1 5 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t   3   =   1 8 0 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 S l o t   1   =   1 8 0 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 	 G o s u b   O p e n G r i p p e r 
 
 	 G o s u b   H o m e 
 
 R e t u r n 
 
 
 
 
 
 L a b e l   O p e n G r i p p e r 
 
 	 S l o t   1 8   =   0 	 	 	 	 '   l i g h t   o f f 
 
 	 W a i t   S e c o n d s   0 . 5 
 
 	 S l o t   1 3   =   2 6 0     	 	 	 '   o p e n   g r i p p e r 
 
 R e t u r n 
 
 
 
 L a b e l   C l o s e G r i p p e r 
 
 	 S l o t   1 8   =   5 0 0 	 	 	 '   l i g h t   o n 
 
 	 S l o t   1 3   =   5 8 0     	 	 	 '   c l o s e   g r i p p e r 
 
 	 W a i t   S e c o n d s   0 . 5 
 
 R e t u r n 
 
 
 
 
 
 
 
 L a b e l   D i s a b l e M o t o r 
 
 	 S l o t   1 1   =   0 
 
 R e t u r n 
 
 
 
 L a b e l   E n a b l e M o t o r 
 
 	 S l o t   1 1   =   1 0 0 0 
 
 R e t u r n 
 
 
 
 
 
 L a b e l   S t a r t P u m p 
 
 	 S l o t   1 1   =   1 0 0 0   	 	 	 ' s t a r t   p u m p 
 
 	 W a i t   S e c o n d s   0 . 5 
 
 R e t u r n 
 
 
 
 L a b e l   S t o p P u m p 
 
 	 S l o t   1 1   =   0   	 	 	 ' s t o p   p u m p 
 
 R e t u r n 
 
 
 
 L a b e l   P u m p 
 
 	 G o s u b   S t a r t P u m p 
 
 	 W a i t   S e c o n d s   1 . 5 
 
 	 G o s u b   S t o p P u m p 
 
 R e t u r n 
 
 
 
 
 
 
 
 '   = = = = = = = = = = = = = = =   H O M E   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   H o m e 
 
 	 G o s u b   H o m i n g _ Z 
 
 	 G o s u b   H o m i n g _ M 2 
 
 	 G o s u b   H o m i n g _ M 1 
 
 	 G o s u b   W a i t A l l M o t o r s 
 
 R e t u r n 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 
 
 '   = = = = = = = = = = = = = = =   H O M I N G   M O T O R   1   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   H o m i n g _ M 1 
 
 	 B e e p 
 
 	 S l o t ( 1 )   =   S l o t ( 1 )   -   0 . 8 	 '   4   d i r e c t i o n   a n d   s p e e d   g o t o   s w i t c h 
 
 	 W a i t   S e c o n d s   0 . 0 2 	 	 	 '   d o   n o t   a l t e r ,   l o o p   t i m e   0 . 0 2   S e c 
 
 	 I f   S l o t ( 7 )   >   5 0 0   	 	 	 '   l i m i t   s w i t c h 
 
 	 	 G o t o   H o m i n g _ M 1 _ 2 
 
 	 E n d I f 
 
 	 G o t o   H o m i n g _ M 1 
 
 L a b e l   H o m i n g _ M 1 _ 2 
 
 	 S l o t ( 1 )   =   S l o t ( 1 )   +   0 . 0 5 	 '   d i r e c t i o n   a n d   s p e e d   r e t u r n   f r o m   s w i t c h 
 
 	 W a i t   S e c o n d s   0 . 0 2 	 	 	 '   d o   n o t   a l t e r ,   l o o p   t i m e   0 . 0 2   S e c 
 
 	 I f   S l o t   ( 7 )   <   5 0 0 	 	 	 '   l i m i t   s w i t c h 
 
 	 	 G o t o 	   H o m i n g _ M 1 _ 3 
 
 	 E n d I f 
 
 	 G o t o   H o m i n g _ M 1 _ 2 
 
 L a b e l   H o m i n g _ M 1 _ 3 
 
 	 S l o t   1   =   R e s e t 	 	 	 	 '   R e s e t   t h e   s l o t   v a l u e 
 
 	 W a i t   S e c o n d s   0 . 0 5 
 
 	 S l o t   1   =   3 0 . 7 	 	 	 	 '   D e c l a r e d   s w i t c h   a n g l e 
 
 	 W a i t   S e c o n d s   0 . 0 5 
 
 	 S l o t   1   =   1 8 0 	 	 	 	 '   m o v e   t o   t h i s   a n g l e 
 
 R e t u r n 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 
 
 '   = = = = = = = = = = = = = = =   H O M I N G   M O T O R   2   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   H o m i n g _ M 2 
 
 	 L o a d   S o u n d \ g o n g . w a v 
 
 	 
 
 	 G o s u b   E n a b l e M o t o r 
 
 	 S l o t ( 3 )   =   S l o t ( 3 )   +   0 . 8 	 '   4   d i r e c t i o n   a n d   s p e e d   g o t o   s w i t c h 
 
 	 W a i t   S e c o n d s   0 . 0 2 	 	 	 '   d o   n o t   a l t e r ,   l o o p   t i m e   0 . 0 2   S e c 
 
 	 I f   S l o t ( 8 )   >   5 0 0   	 	 	 '   l i m i t   s w i t c h 
 
 	 	 G o t o   H o m i n g _ M 2 _ 2 
 
 	 E n d I f 
 
 	 G o t o   H o m i n g _ M 2 
 
 L a b e l   H o m i n g _ M 2 _ 2 
 
 	 S l o t ( 3 )   =   S l o t ( 3 )   -   0 . 0 5 	 '   d i r e c t i o n   a n d   s p e e d   r e t u r n   f r o m   s w i t c h 
 
 	 W a i t   S e c o n d s   0 . 0 2 	 	 	 '   d o   n o t   a l t e r ,   l o o p   t i m e   0 . 0 2   S e c 
 
 	 I f   S l o t   ( 8 ) <   5 0 0 	 	 	 '   l i m i t   s w i t c h 
 
 	 	 G o t o 	   H o m i n g _ M 2 _ 3 
 
 	 E n d I f 
 
 	 G o t o   H o m i n g _ M 2 _ 2 
 
 L a b e l   H o m i n g _ M 2 _ 3 
 
 	 S l o t   3   =   R e s e t 	 	 	 	 '   R e s e t   t h e   s l o t   v a l u e 
 
 	 W a i t   S e c o n d s   0 . 0 5 
 
 	 S l o t   3   =   1 8 1 	 	 	 	 '   D e c l a r e d   s w i t c h   a n g l e 
 
 	 W a i t   S e c o n d s   0 . 0 5 
 
 	 S l o t   3   =   1 8 0 	 	 	 	 '   m o v e   t o   t h i s   a n g l e 
 
 R e t u r n 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 
 
 '   = = = = = = = = = = = = = = =   H O M I N G   M O T O R   Z   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   H o m i n g _ Z 
 
 	 G o s u b   E n a b l e M o t o r 
 
 	 S l o t ( 5 )   =   S l o t ( 5 )   +   0 . 1 	 	 '   d i r e c t i o n   a n d   s p e e d   g o t o   s w i t c h 
 
 	 W a i t   S e c o n d s   0 . 0 2 	 	 	 '   d o   n o t   a l t e r ,   l o o p   t i m e   0 . 0 2   S e c 
 
 	 I f   S l o t ( 9 )   >   5 0 0   	 	 	 '   l i m i t   s w i t c h 
 
 	 	 G o t o   H o m i n g _ Z _ 2 
 
 	 E n d I f 
 
 G o t o   H o m i n g _ Z 
 
 
 
 L a b e l   H o m i n g _ Z _ 2 
 
 	 S l o t ( 5 )   =   S l o t ( 5 )   -   0 . 0 1 	 '   d i r e c t i o n   a n d   s p e e d   r e t u r n   f r o m   s w i t c h 
 
 	 W a i t   S e c o n d s   0 . 0 2 	 	 	 '   d o   n o t   a l t e r ,   l o o p   t i m e   0 . 0 2   S e c 
 
 	 I f   S l o t   ( 9 ) <   5 0 0 	 	 	 '   l i m i t   s w i t c h 
 
 	 	 G o t o   H o m i n g _ Z _ 3 
 
 	 E n d I f 
 
 G o t o   H o m i n g _ Z _ 2 
 
 
 
 L a b e l   H o m i n g _ Z _ 3 
 
 	 S l o t   5   =   R e s e t 	 	 	 	 '   R e s e t   t h e   s l o t   v a l u e 
 
 	 W a i t   S e c o n d s   0 . 0 5 
 
 	 S l o t   5   =   1 3 0 	 	 	 	 '   D e c l a r e d   s w i t c h   a n g l e 
 
 	 W a i t   S e c o n d s   0 . 0 5 
 
 	 S l o t   5   =   1 2 5 	 	 	 	 '   m o v e   t o   t h i s   a n g l e 
 
 R e t u r n 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 
 
 
 
 
 
 
 
 L a b e l   K e y C l o s e G R I P P E R 
 
 	 S l o t ( 7 )   =   S l o t ( 7 )   -   5 
 
 R e t u r n 
 
 
 
 L a b e l   M o v e R i g h t 
 
 	 S l o t ( 1 )   =   S l o t ( 1 )   -   1 2 
 
 R e t u r n 
 
 
 
 L a b e l   M o v e L e f t 
 
 	 S l o t ( 1 )   =   S l o t ( 1 )   +   1 2 
 
 R e t u r n 
 
 
 
 L a b e l   M o v e U p 
 
 	 S l o t ( 3 )   =   S l o t ( 3 )   +   1 2 
 
 R e t u r n 
 
 
 
 L a b e l   M o v e D o w n 
 
 	 S l o t ( 3 )   =   S l o t ( 3 )   -   1 2 
 
 R e t u r n 
 
 
 
 L a b e l   M o v e U p p e r 
 
 	 S l o t ( 5 )   =   S l o t ( 5 )   +   8 
 
 R e t u r n 
 
 
 
 L a b e l   M o v e L o w e r 
 
 	 S l o t ( 5 )   =   S l o t ( 5 )   -   8 
 
 R e t u r n 
 
 
 
 ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 ' - - - - -   s u b r o u t i n e   a r e a   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 
 
 L a b e l   W a i t A l l M o t o r s 
 
 '   - - - - - - - - - - - - - - - - - -   t h i s   W a i t   e n s u r e s   t h a t   t h e   m o t o r s   a r e   r e a l l y   s t a r t e d 
 
 	 W a i t   S e c o n d s   0 . 1 
 
 	 L a b e l   W a i t A l l M o t o r s 2 
 
 	 	 I f   A b s ( S l o t ( 2 ) )   <   0 . 0 1   A n d   A b s ( S l o t ( 4 ) )   <   0 . 0 1   A n d   A b s ( S l o t ( 6 ) )   <   0 . 0 1 
 
 	 	 	 R e t u r n 
 
 	 	 E n d I f 
 
 	 	 W a i t   S e c o n d s   0 . 0 1 
 
 	 G o t o   W a i t A l l M o t o r s 2 
 
 '   - - - - - - - - - - - - - - - - - -   t h i s   l i n e   i s   r e q u i r e d   t o   i n d e n t   c o r r e c t l y 
 
 G o t o   W a i t A l l M o t o r s 
 
 
 
 
 
 ' = = = = = =   D U M M Y   A R E A   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 
 
 ' = = = = = =   T O   D O   A R E A   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 ' I n i t a l   d e t a c h   i n   t h e   s w i t c h   a r e   o p e r a t e d   o n   h o m e   f u n c t i o n s 
 
 
 
 
 
 ' W A T C H   N e w   w a t c h 
 
 