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