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