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