














                                      CAM

                           Interface/Control Language
                            for special needs users.



                                  Version 1.6

                               Revised 23-Feb-02





                                  for Cameron





                       Copyright 1982-2005 Dave Dunfield
                              All rights reserved.



                                      CAM

                               TABLE OF CONTENTS


                                                                         Page

     1. INTRODUCTION                                                        1


     2. EXTERNAL INTERFACES                                                 2

        2.1 Remote Keyboard                                                 2
        2.2 Analog inputs                                                   3
        2.3 Infared remote control                                          3
        2.4 Sound Card                                                      4

     3. STARTING CAM                                                        6


     4. LANGUAGE SUMMARY                                                    7

        4.1 Numbers                                                         7
        4.2 Character strings                                               7
        4.3 Variables                                                       7
        4.4 Functions                                                       8
        4.5 Operators                                                      11
        4.6 Statements                                                     12
        4.7 Error Messages                                                 24
        4.8 Control-C                                                      25

     5. UTILITY PROGRAMS                                                   26

        5.1 The RENUMBER utility                                           26
        5.2 The SOUND utility                                              27
        5.3 The SCREEN utility                                             28
        5.4 The IREDIT utility                                             28
        5.5 The CP290 utility                                              28
        5.6 The MICROCAD utility                                           28

     6. SAMPLE APPLICATIONS                                                29

        6.1 Main Menu                                                      29
        6.2 Sequence training                                              29
        6.3 Story Book                                                     29
        6.4 CD Jukebox                                                     30
        6.5 Joystick Beeper                                                30
        6.6 Circle tray                                                    30
        6.7 Note about voice files                                         30

     7. PC CONNECTIONS AND PINOUTS                                         31

        7.1 Game connector pin assignments                                 31
        7.2 Printer connector pin assignments                              31

    CAM                                                    Table of Contents

                                                                         Page
        7.3 Serial connector pin assignments                               32
        7.4 Keyboard connector pin assignments                             32
        7.5 Video connector pin assignments                                32
        7.6 CP290 Connections (to PC)                                      33
    CAM                                                              Page: 1


    1. INTRODUCTION

       CAM is a special purpose version of the BASIC  (Beginners All purpose
       Symbolic Instruction Code)  computer language,  which has  extensions
       for  controlling  non-standard   hardware   and   control   functions
       specifically  designed  for  the  purpose  of  providing  a  computer
       interface for a child with special needs.

       Although designed to help children,  CAM is by no  means  limited  to
       this application.  It can be  applied  to  any  project  which  could
       benefit  from   its   interfaces,   such   as   automated   displays,
       presentations, simulations etc. The possibilities are endless.

       CAM is not intended for "general purpose" software development.  As a
       programming language it is quite simple, but adaquate for the control
       and interface functions for which it is  intended.  It's  real  value
       lies in it's  "built in"  ability to interface  with  and  control  a
       variety of unconventional I/O hardware.

          The interfaces currently supported by CAM are:

            1 - Standard PC keyboard and video display
            2 - A separate Four-button input keypad
            3 - Beeps and melodies via the PC speaker
            4 - Sound input/output via a "Sound Blaster" card
            5 - Text-to-speech via a "Sound Blaster" card
            6 - Infa-red "remote" control of external devices
            7 - Analog knobs, dials, levers etc.
            8 - Digital I/O via "parallel" port.
            9 - X10 "Home Control" devices via CP290 interface

       WARNING! Installing and connecting the external  interfaces  requires
       some knowledge  and  skill  with  electrical  wiring  and  mechanical
       devices.  If you do not have these talents,  you are STRONGLY advised
       to seek the assistance of someone who does.  Poorly designed,  poorly
       constructed or improperly wired interfaces can be dangerous!

       In the development of CAM, I have tried to insure that it will run on
       minimal hardware,  so that you can take advantage of older  equipment
       that may be available at little or no cost.  The program itself  will
       run on 8088 and 80286 based computers, although newer Sound Cards and
       associated drivers may dictate a higher level platform.

       CAM is available free of charge for non-profit use. All I ask is that
       if you create anything with this system that could be of  benefit  to
       others,  that you also make it  available  free  of  charge.  Updated
       versions of CAM as well as any submissions from  the  users  will  be
       made available on my BBS (See enclosed CATALOG file).

       Also, if you redistribute this software,  please do so in the form of
       my original .ZIP archive.
    CAM                                                              Page: 2


    2. EXTERNAL INTERFACES

       Since CAM is designed to provide an interface for someone who may not
       be able to use the  keyboard  and  video  display,  several  external
       interface methods are provided.

       2.1 Remote Keyboard

          The remote keypad will consist of  four  buttons,  although  fewer
          button can be implemented if the  applications  will  not  require
          four.  In most cases,  the keypad will be large  easy  to  operate
          buttons or levers. A variety of colors, shapes, textures etc.  can
          be used to distinguish the buttons,  depending on the capabilities
          of the intended user.  If desired,  large knobs controlling one or
          more analog inputs (see below)  can be physically located with the
          remote keypad.

          The remote keypad can be interfaced either via the game (joystick)
          port, or a parallel (printer) port on the PC.

          2.1.1 GAME port

             The keypad is interfaced by the A1,A2,B1 and B2 switch  inputs.
             Each keypad button should be a  Normally  Open  SPDT  momentary
             contact push button connected between the signal/pin  indicated
             below and any one of the  "Ground"  pins  (4,5,12)  of the PC's
             DB-15 game port connector.

                      Button#      Pin#     SIGNAL NAME
                        1            2          A1
                        2            7          A2
                        3           10          B1
                        4           14          B2
                        n/a       4,5,12        Ground

             NOTE: That some game ports do not support the B1,B2 inputs (The
             ones on Sound Blaster cards do).

          2.1.2 Parallel port

             The keypad is interfaced using the -ERROR,  BUSY,  PE and  SLCT
             input lines.  Each keypad button should be a Normally Open SPST
             momentary contact push button connected between the  signal/pin
             indicated below and any one of the "Ground" pins (18-25) of the
             PC's DB-25 parallel port connector.

                      Button#      Pin#     SIGNAL NAME
                        1           15         -ERROR
                        2           11          BUSY
                        3           12          PE
                        4           13          SLCT
                        n/a         18-25       Ground
    CAM                                                              Page: 3


             NOTE:  Most parallel ports  will  work  with  only  the  ground
             connection indicated,  however some may also require  "pull-up"
             resistors  (5k)  to be connected between the signal  input  and
             +5volts.  You can obtain +5volts from the RED wire  of  a  disk
             drive power connector, or from the GAME port (see below).

       2.2 Analog inputs

          The analog inputs are read from the  game  (joystick)  port.  Each
          input consists of a variable resistance (0-150K) connected between
          the signal/pin indicated below, and the "+5volts" pins (1 or 9) of
          the PC's DB-15 game port connector.

                      Input#       Pin#     SIGNAL NAME
                        1            3          AX
                        2            6          AY
                        3           11          BX
                        4           13          BY
                        n/a        1,9         +5volts

       2.3 Infared remote control

          The Infared remote control is an 8031 based  dedicated  controller
          that interfaces to the PC via a  serial  port.  Complete  details,
          drawings,  firmware  etc.  for  this  device  (called  IR232)  are
          contained in separate files accompanying this package.
    CAM                                                              Page: 4


       2.4 Sound Card

          The sound interface uses Creative Labs SOUND BLASTER card, and the
          CT-VOICE.DRV  software  device  driver  (included  with  all   DOS
          versions  of  the  SOUND  BLASTER).  To  use  the   text-to-speech
          features,  you must also have the SBTALKER.EXE driver.  If you are
          considering using a "clone" card, make sure that it includes these
          drivers (unlikely).

          The sound card must be installed and configured according  to  the
          manufacturers instructions, including:

            - SOUND environment variable set to Sound Card directory.
            - CT-VOICE.DRV located in DRV subdirectory of above.
            - BLASTER environment variable set with card settings.
            - Low level drivers loaded (if necessary).
            - SBTALKER.EXE loaded (if text-to-speech is desired).

          CAM has been tested and verified  to  work  correctly  with  SOUND
          BLASTER 1.5,  2.0,  SBPRO and SB16 cards.  Older versions of these
          cards require only the CT-VOICE.DRV file to be located in  a  \DRV
          subdirectory under the  "home"  directory indicated by  the  SOUND
          environment variable.  Later versions of the  cards  also  require
          "Low level" device drivers (CTSB, CTSB2, CTSBPRO or CTSB16.SYS and
          CTMMSYS.SYS)  to be loaded in your CONFIG.SYS files.  Consult your
          sound card documentation for details on installing and configuring
          your particular card.

          If  the  BLASTER  environment  variable  exists  (See  sound  card
          installation docs),  CAM will attempt to reconfigure to  the  Card
          type,  Address,  interrupt  and  Dma  channel  to  the  parameters
          indicated, otherwise the default settings configured in the driver
          will be used.  (see INST-DRV/INSTDRV program  supplied  with  some
          cards).  Note CAM uses 'Tn'  setting from BLASTER to determine the
          type of MIXER on the card.  If incorrect,  MIX  command  will  not
          work.

          Sound files for use by CAM applications can be prepared  with  the
          many sound editors and related utilities that  are  available.  We
          found the VEDIT2 .VOC file editor from Creative Labs  to  be  very
          useful,  due to its ability to manipulate  individual  blocks  and
          insert marker records (for sequencing).

          NOTE1:  VEDIT2 is apparently no longer supplied with Sound Blaster
          cards,  and older versions of VEDIT2 may not work  correctly  with
          newer cards due to a  new  record  type  (9)  implemented  in  the
          CT-VOICE driver. The last version of VEDIT2 (2.15) works correctly
          with these drivers, and is is available from the Creative Labs web
          page  (see below),  and probably their Compuserve  forum  and  BBS
          (unverified).

          NOTE2:  Although VEDIT2 was not officially supported on the  SB1.5
          cards,  and did not work with them "out of the box",  I discovered
          that the updated DOS SB15 drivers  from  Creative  Labs  web  page
          enabled this combination to work.
    CAM                                                              Page: 5


          As manufacturers embrace  new  graphical  operatings  systems  and
          industry trends,  they have tended to drop support for  the  older
          DOS environment on which CAM relies.  The CT-VOICE,  SBTALKER  and
          VEDIT2 drivers/utilities used by CAM are  (or were  at  one  time)
          standard features included with  SOUND  BLASTER  cards.  As  these
          programs are the proprietary property of Creative Labs,  you  will
          have to contact them if you are missing any of them:

          Good places to obtain updated Creative Labs files is:

            Creative Labs web page:     http://www.creaf.com
            Creative Labs BBS system:   (405) 742-6660
            Creative Labs Compuserve Forum

            Creative Labs, Inc.  Technical Support
            1523 Cimarron Plaza, Stillwater, OK 74075 U.S.A.
            TEL (405) 742-6622          FAX (405) 742-6633

          Files which are of special interest on the above sites:

            SB15DU.EXE      - Updated DOS drivers for: SB 1.5
            SB20DU.EXE      - Updated DOS drivers for: SB 2.0
            SBPDU.EXE       - Updated DOS drivers for: SB PRO
            SBMDU.EXE       - Updated DOS drivers for: SB MCV
            SBP2DU.EXE      - Updated DOS drivers for: SB PRO-2
            SBPMDU.EXE      - Updated DOS drivers for: SB PRO MCV
            SBBASIC.EXE     - Basic DOS/WIN31 install disk for SB16/32
            CTCMBBS.EXE     - Creative "Plug & Play" Configuration Manager
            VEDIT215.EXE    - VEDIT2 version 2.15 (latest)

          The above files should provide you with a compatible  CT-VOICE.DRV
          file for any of the listed cards,  and the VEDIT2 voice editor.  I
          was unable to find any version of the SBTALKER.EXE program on  the
          web site.  I received SBTALKER with the last non-P&P SB16  that  I
          purcased,  however the latest ones that I have  obtained  (P&P/W95
          versions)  did not include this program.  Again,  contact Creative
          Labs at the voice/fax numbers above.

          I apologize for the problems involved in finding suitable  drivers
          for recent cards, however I would like to point out that the audio
          interfaces of CAM were developed (and made to rely on these files)
          using the guidelines set out in Creative Labs own  "Developer  Kit
          for Sound Blaster Series"...

          New in CAM 1.6:  To simplify sound card setup,  CAM now looks  for
          the CT-VOICE.DRV driver in the CAM install directory if the SOUND=
          environment variable does not exist. I have also included SBDRV, a
          utility which will create a preconfigured CT-VOICE.DRV driver  for
          most ISA Sound Blaster cards.
    CAM                                                              Page: 6


    3. STARTING CAM

       The syntax of the CAM command line is:

      CAM [/? /Bvalue /D /Icom /Kadr /Padr,inv /Sseed] [filename [parms]]

       The '/B' option specifies the "debounce"  count  (/B1 - /B65535)  for
       the remote keypad buttons.  Once a button is pressed, the system will
       not recognize it's release until it has been OFF  for  an  amount  of
       time set by this parameter  (higher values = longer time).  The exact
       time is dependant on your system speed  (A given debounce value  will
       result in LESS time on a faster computer).

       The '/D' option enables debugging messages in the various interfacing
       functions which have been added to the language.

       The '/I' option specifies the communications port  (/I1 - /I4)  to be
       used for  the  IR232  infrared  remote  control  interface.  If  this
       parameter is not given, the IR232 interface is disabled.

       The  '/K'  option specifies a hexidecimal parallel port address which
       is to be  used  for  reading  the  remote  keypad  buttons.  If  this
       parameter is not given,  the game (joystick)  port A1,A2,B1,B2 inputs
       are used instead. Typical values for PC parallel ports are:

            LPT1: /K3BD         LPT2: /K379         LPT3: /K279

       The  '/P'  option specifies a hexidecimal parallel port address to be
       used for the control signals of the OSET,  ON and  OFF  commands.  16
       bits of I/O will be written to the address given, and the address +2.
       An optional  "invert"  value  can  be  specified  which  inverts  the
       corresponding I/O bits, allowing for negative logic signals.  Typical
       values for PC parallel ports are:

            LPT1: /P3BC         LPT2: /P378         LPT3: /P278

       The  '/S'  option specifies the RANDOM SEED value which will be used.
       This value determines the sequence of numbers that will  be  returned
       by the RND()  function.  Starting CAM with a preset seed value allows
       you to test a program with the same random numbers every time. If not
       specified,  the seed is initialzed to the BIOS clock tick,  providing
       an undetermined sequence.

       The /B, /I,  /K and /P options can be set permanently with the CAMSET
       utility which patches the CAM program directly. Use /? to see a brief
       summary of the CAM or CAMSET options.

       If a 'filename' is specified, CAM will automatically load and run it,
       then terminate. Additional parameters may be specified on the command
       line,  and they will be made available as string variables A1$,  A2$,
       A3$ etc. A0$ will contain the name of the program.
    CAM                                                              Page: 7


    4. LANGUAGE SUMMARY

       CAM in built around a fairly simple but functional subset of the well
       known BASIC computer language.  The details  of  this  implementation
       are:

       4.1 Numbers

          CAM uses  "16 bit integer"  numbers.  This means that any  numeric
          values used in a program must fall  in  the  range  of  -32768  to
          32767.  For CAM's  intended  purposes  of  control  and  interface
          functions,  this type of number  is  more  than  adaquate.  Within
          expressions, numbers can be expressed in hexidecimal by preceeding
          them with '$'.

       4.2 Character strings

          CAM can also manipulate character strings.  Character strings  are
          identified by the double-quote (")  character,  and are limited to
          100 characters or less in length.

       4.3 Variables

          CAM provides a total of 780 "variables" which may be used to store
          numbers and  character  strings.  These  are  divided  into  three
          "types"  of 260 variables each.  The variables of  each  type  are
          identified with a single character from the alphabet  followed  by
          digit from 0 to 9; ie: A0-Z9.

          4.3.1 Simple numeric variables: A0 - Z9

             These variables are the most commonly used,  and can each store
             one number (-32768 to 32767).  They are used for loop counters,
             input values, and general purpose calculations.

          4.3.2 String variables: A0$ - Z9$

             These variables can  hold  character  strings.  These  "string"
             variables are identified by a  '$'  appended to the name.  They
             are normally used for  input  strings,  names,  and  any  other
             non-numeric data.

             String  variables  allow   indexing   to   extract   individual
             characters:

                A0$(n)  = Return character n (0 to length-1)

          4.3.3 Numeric arrays: A0(index) - Z9(index)

             These variables can each  hold  multiple  numbers.  Unlike  the
             others, variables of this type must be explicitly created (with
             the 'DIM' statement). They are typically used for tables, lists
             and any applications which uses a group of numbers.

          As a matter of convience,  the '0'  variables can be referenced by
          letter only.  Ie: A is equivalent to A0,  B$ is equivalent to B0$,
          and Z(index) is equivalent to Z0(index)
    CAM                                                              Page: 8


       4.4 Functions

          CAM includes a number of "built in" functions which can be used as
          values in an expression:

          4.4.1 CHR$(value)

             This function converts a number into an  ASCII  character.  For
             example:  the ASCII value of the character  'A'  is 65.  Coding
             CHR$(65) would be equivalent to "A". This is the reverse of the
             ASC() function.

          4.4.2 STR$(value)

             This function converts a number into a character string. Coding
             STR$(1234)  would be equivalent to  "1234".  This is reverse of
             the NUM() function.

          4.4.3 ABS(value)

             This function returns the "absolute value" of a number, which a
             number of  the  same  magnitude,  with  a  positive  sign.  For
             example:  ABS(5) and ABS(-5) would both evaluate to a number of
             5.

          4.4.4 ASC(char)

             This function converts  a  character  into  its  numeric  ASCII
             value.  For example: coding ASC("A") would be equivalent to 65.
             This is the reverse of the CHR$() function.

          4.4.5 INP(port)

             This function reads an 80x86 I/O port.  It is used to  directly
             manipulate hardware that is not supported by CAM.

          4.4.6 KEY()

             This function tests to see if a key has been pressed on the  PC
             keyboard,  and if so,  returns its ASCII value.  If no key  has
             been pressed, KEY() returns 0.

          4.4.7 LEN(variable)

             Returns the length of the specified string or  array  variable.
             If the variable has a  '$'  suffix,  the length return  is  the
             number of characters in the character variable.  If no '$', the
             length  returned  is  the  number  of  elements  in  the  array
             variable.

          4.4.8 NUM(string)

             This function converts a character string containing  a  number
             into a numeric value. Coding NUM("1234") would be equivalent to
             1234. This is the reverse of the STR$() function.
    CAM                                                              Page: 9


          4.4.9 RND(value)

             This function generates a  "random"  number which will fall  in
             the range  of  0  to  (value-1).  For  example:  RND(10)  would
             generate a number ranging from 0 to 9.

          4.4.10 BUTTON(mask)

             This function tests for a button press on the external  keypad.
             The mask parameter identifies which buttons are to be  allowed.
             The value of mask is determined by adding up  values  from  the
             following table:

                Button1     1       <- Allow button1
                Button2     2       <- Allow button2
                Button3     4       <- Allow button3
                Button4     8       <- Allow button4
                Wait        256     <- Wait for a button before proceeding
                Immediate   512     <- Don't sound tone/wait till release

             If the "Wait" function is included, BUTTON() will stop and wait
             until an allowed button has been pressed,  and then return  the
             button number  (1-4).  If the "Wait" function is not specified,
             BUTTON() will return 0 if no button is being pressed, otherwise
             the button number as above.

             If the "Immediate" function is specified,  BUTTON() will return
             with the button number immediately,  otherwise it will sound  a
             unique tone identifying the button which will persist until the
             button is released.

             The BUTTON()  function will also accept the numeric keys 1-4 on
             the PC keyboard to simulate a button press.  ESCAPE can be used
             to force BUTTON() to return 0 (no key pressed).

          4.4.11 JOYSTICK(index)

             This function provides access to the game (joystick)  port.  An
             index value of 1-4 reads  the  corresponding  analog  input.  A
             value from 0 - <n> is returned,  where <n> is dependant on your
             computer speed and game port hardware.

             An index value of 0 is a  special  case,  and  provides  direct
             access to the game port digital inputs  (buttons).  A value  is
             returned with bits 0,1,2,3 containing the status (1=Closed)  of
             the A1,A2,B1,B2 digital inputs.
    CAM                                                              Page: 10


          4.4.12 TIME(index)

             This function reads the computers real time  clock.  The  value
             returned depends on the index value.  NOTE:  TIME(1-8)  are not
             re-read from the system when  different  TIME()  functions  are
             used on a single line:

                0   - BIOS tick     (increments every 1/18 sec)
                1   - Second        (0-59)
                2   - Minute        (0-59)
                3   - Hour          (0-23)
                4   - Day           (1-31)
                5   - Month         (1-12)
                6   - Year          (1980-2099)
                7   - Day of week   (0=Sun ... 6=Sat)
                8   - Time since midnight in 5 second intervals (0-17280)
    CAM                                                              Page: 11


       4.5 Operators

          Numbers,  Strings,  Variables and  Function  may  be  formed  into
          expressions and manipulated with the following operators:

            +           Addition and String concatination   ($)
            -           Subtraction
            *           Multiplication
            /           Division
            %           Modulus (remainder)
            &           Bitwise AND
            |           Bitwise OR
            ^           Bitwise EXCLUSIVE OR
            =           Assignment / Test EQUAL             ($)
            <>          Test NOT EQUAL                      ($)
            <           Test LESS THAN
            <=          Test LESS THAN or EQUAL
            >           Test GREATER THAN
            >=          Test GREATER THAN or EQUAL
            !           Bitwise NOT (complement)

          Operators denoted with ($) can be applied to strings.

          When applied to strings, '+' performs string concatination,  which
          is the operation of joining two strings  into  one.  For  example:
          "ABC"+"DEF" is equivalent to "ABCDEF".

          The "test" operators (=,  <>,  <,  <=,  >,  >=) can be used in any
          expression, and evaluate to 1 of the test is TRUE,  and 0 if it is
          FALSE.
    CAM                                                              Page: 12


       4.6 Statements

          All  actions  performed  by  the  CAM   program   are   coded   as
          "statements",  which  are  commands  directing  the   interpreter.
          Statements often contain expressions as described above to perform
          calculations.

          Most statements can be used  either  from  within  a  program,  or
          interactively  from  the  command  line  "Ready"   prompt.   Those
          statements which are only available in one or the other  mode  are
          noted.

          4.6.1 BEEP frequency,milliseconds

             Generates a tone from the PC speaker at the indicated frequency
             (hz), for the specified duration (milliseconds).

                10 REM Generate a 1000hz tone for 1/2 second
                20 BEEP 1000,500

          4.6.2 CLEAR

             Erases all variables.  All numeric variables are set  to  zero.
             All string variables are set to null (0 length), and all arrays
             are removed.

                10 REM clear all variables
                20 CLEAR

          4.6.3 CLOSE#unit

             Closes a previously opened file (0-9). See 'OPEN#unit'.

                10 REM Close file # 5
                20 CLOSE#5

          4.6.4 CLS [attribute]

             Clears  the  video  screen  to  blanks,  using  the   specified
             attribute.  If no attribute is given,  a value of 7  (white  on
             blank) is used.

                10 REM Clear the screen
                20 CLS
    CAM                                                              Page: 13


          4.6.5 CONTROL "string" | function

             Issues an I/R control command through the IR232 interface. This
             has the effect of activating the corresponding function  as  if
             that button has been pushed on a "remote" control.

             If the argument to CONTROL is  a  character  string,  then  the
             available I/R control sequences are loaded from a file by  that
             name.  A numeric operand causes the corresponding  I/R  control
             sequence from the last  loaded  file  to  be  transmitted.  The
             sequences are selected based on the order in  which  they  were
             recorded by the IREDIT utility program. CONTROL 0 activates the
             first code (0)...

                10 REM Load the I/R control codes from CAM.IRD
                20 CONTROL "CAM.IRD"
                30 REM Issue command#1 to remote device
                40 CONTROL 1

          4.6.6 DATA

             Codes numeric and string variables in  the  program  text  such
             that they can be read with the READ statement.  See 'READ'  and
             'ORDER'.

             DATA statements encountered  during  the  normal  flow  of  the
             program are ignored.  They are only used as sources of data for
             the READ statement.

             DATA can only be used within a program (non-interactive).

                10 REM Data for READ
                20 DATA 1,2,3,"text"
                30 DATA 4,5,6,"more text"

          4.6.7 DELAY milliseconds

             Causes the  program  to  pause  for  the  specified  number  of
             milliseconds.

                10 REM Pause for 2 seconds
                20 DELAY 2000

          4.6.8 DIM variable(size)[, ...]

             This command "dimensions"  (creates)  a numeric array variable.
             The size parameter defines the maximum index value which can be
             used with the array.

             If an array of the same name  was  previously  defined,  it  is
             erased first. All elements of the new array are set to zero.

             Note that CAM starts numbering its elements from 0,  while most
             other BASIC's start numbering elements from 1.

                10 REM Define arrays 11 elements (0-10) and 100 elements
                20 DIM A(10), A1(99)
    CAM                                                              Page: 14


          4.6.9 DOS "command"

             Passes a string to the DOS command interpreter to  be  executed
             as a DOS command (See also 'QDOS').

                10 REM Display graphic with CSHOW (shareware viewer)
                20 DOS "CSHOW "+A$+"+X"

          4.6.10 END

             Terminate execution of the program. No message is issued.

                10 REM End program quietly
                20 END

          4.6.11 EXIT

             Terminates CAM and exits back to DOS.

                10 REM Terminate CAM
                20 EXIT

          4.6.12 FOR variable=value TO limit [STEP increment]

             Begins a counted loop.  The variable begins with the  specified
             value. The program segment between FOR and a corresponding NEXT
             statement is repeated until the variable exceeds the  specified
             limit.  After each loop,  the variable is  incremented  by  the
             increment value.  If no increment value is specified, a default
             value of 1 is used.

             FOR can only be used within a program (non-interactive).

                10 REM Count to 10 and print it
                20 FOR i=1 to 10
                30 PRINT I
                40 NEXT I

          4.6.13 GOSUB line

             Calls a  subroutine.  The  program  segment  beginning  at  the
             specified line number is executed until a RETURN  statement  is
             encountered,  after which the program  continues  at  the  next
             statement after GOSUB.

             GOSUB can only be used within a program (non-interactive).

                10 REM Call a subroutine
                20 PRINT "start"
                30 GOSUB 80
                40 PRINT "middle"
                50 GOSUB 80
                60 PRINT "end"
                70 END
                80 PRINT "subroutine"
                90 RETURN
    CAM                                                              Page: 15


          4.6.14 GOTO line

             Causes a "jump" to the specified line number.  The program will
             continue at the first statement in the indicated line.

             GOTO can only be used within a program (non-interactive).

                10 REM goto example
                20 PRINT "Hello"
                30 GOTO 20

          4.6.15 GOTOXY x,y

             Positions  video  output  cursor  at  the  specified  x  and  y
             coordinates.

                10 REM postion to cursor and then output a message
                20 GOTOXY 10,10:print "Hello"

          4.6.16 IF test THEN statement/line

             Performs a statement conditionaly upon a  test.  The  indicated
             test expression is evaluated,  and if the result  is  non-zero,
             the specified statement is performed. As a shorthand convience,
             a statement consisting of only a number is assumed to be  "GOTO
             number".

                10 REM IF example
                20 FOR i=1 TO 10
                30 IF i=5 THEN PRINT "I is five"
                40 IF i<>8 THEN 60
                50 PRINT "I is eight"
                60 NEXT i

          4.6.17 INPUT ["prompt",]variable

             Prompts for a variable.  The specified prompt is displayed, and
             a single line of input is accepted from the console,  which  is
             assigned to the indicated variable.  String  variables  receive
             the input unchanged.  Numeric variables cause the input line to
             be evaluated to a number.

             If no "prompt"  string is given,  a default of "?"  is assumed.
             Note that you cannot directly use a character variable  as  the
             prompt  (Input  assumes  that  you  are  inputting   into   the
             variable), but you can use one concatinated to a string.

                10 REM INPUT example
                20 INPUT A
                30 PRINT "A=",A
                40 INPUT A$
                50 INPUT ""+A$,B
                60 PRINT "B=",B
    CAM                                                              Page: 16


          4.6.18 INPUT#unit,variable

             Reads the contents of a variable from a file previously  opened
             with OPEN#unit.

                10 REM open example
                20 OPEN#1,"TEST.FIL","r"
                30 INPUT#1,A$
                40 CLOSE#1
                50 PRINT "A$=",A$

          4.6.19 LET variable = expression

             Assigns the value of the expression to the specified  variable.
             The  "LET"  keyword is optional,  since  the  interpreter  will
             assume LET for any statement which it does not recognize.

                10 REM LET example
                20 LET a=10
                30 A$="test string"

          4.6.20 LIF test THEN statements

             Performs a  "long if".  This statement behaves exactly like the
             IF statement,  except that  ALL  statements  on  the  line  are
             conditional on the test.

                10 REM IF/LIF example
                20 INPUT "Enter a number?",A
                30 IF A = 1 THEN PRINT "A=1" : PRINT "TEST1"
                40 LIF A = 2 THEN PRINT "A=2" : PRINT "TEST2"
                50 IF A<>0 THEN 20

          4.6.21 LIST [start,[end]]

             Displays the program on the console.  If  one  line  number  is
             given,  only that line is listed.  If both start and end  lines
             are given, only that range is listed.

                LIST
                LIST 10
                LIST 10,50

          4.6.22 LIST#unit

             Behaves exactly like LIST except that the program is written to
             a previously opened file (0-9).

                10 REM List to file demo
                20 OPEN#1,"PGM.BAS","wv"
                30 LIST#1
                40 CLOSE#1
    CAM                                                              Page: 17


          4.6.23 LOAD "file"

             Loads the specified CAM program file into memory.  Any previous
             program is erased. The extension ".BAS" is assumed.

             When used interactively,  all variables  are  erased  prior  to
             loading the new program.

             When  used  within  a  program,  LOAD  performs  a   "chaining"
             function.  The new program is loaded, and immediately begins to
             run.  In this case,  the variables are NOT erased,  and may  be
             used as a means of  communication  between  the  two  programs.
             NOTE:  If you do not  need  to  pass  variables  to  a  chained
             program, it is a good idea to execute CLEAR just prior to LOAD.
             This makes it much easier for CAM to manage  memory,  and  also
             insures that the new program will start with  a  clean  set  of
             variables.

                LOAD "program"

                10 REM LOAD demo
                20 CLEAR
                30 A$="String to pass"
                40 LOAD "next"

          4.6.24 NEW

             Erases the program and all variables.

                NEW

          4.6.25 NEXT [variable]

             Terminates a FOR loop (see FOR).  If a variable is specified it
             must match the one in the corresponding FOR statement.

             NEXT can only be used within a program (non-interactive).

                10 REM FOR/NEXT demo
                20 FOR i=1 TO 100 STEP 2
                30 PRINT I
                40 NEXT

          4.6.26 OFF value

             Turns OFF digital I/O devices connected to the  parallel  port.
             All signals corresponding to the 1  bits  in  the  operand  are
             deactivated.

          4.6.27 ON value

             Turns ON digital I/O devices connected to  the  parallel  port.
             All signals corresponding to the 1  bits  in  the  operand  are
             activated.
    CAM                                                              Page: 18


          4.6.28 OPEN#unit,"filename","options"

             Opens a file for input  or  output  using  the  specified  unit
             number. The "options" available are:

                a   - Append: Append when WRITEing
                r   - Read: Open file for READ
                w   - Write: Open file for WRITE
                v   - Verbose: Display message if error
                q   - Quit: Terminate program if error
                b   - Binary: Do not perform CRLF translation

                10 REM OPEN/PRINT to file
                20 OPEN#1,"test.fil","w"
                30 PRINT#1,"This is a test"
                40 CLOSE#1
                50 REM OPEN/INPUT from file
                60 OPEN#2,"test.fil","r"
                70 INPUT#2,A$
                80 PRINT "A$=",A$
                90 CLOSE#2

          4.6.29 ORDER line

             Positions the DATA/READ pointer to a specific  line.  The  line
             MUST begin with a DATA statement.  This command must  be  given
             before a READ statement can be  used  at  the  beginning  of  a
             program,  and again after all data has been read  from  a  data
             block.

             Once the data pointer has been  set,  READ  will  automatically
             accept data from multiple DATA  statements,  but  it  will  not
             automatically skip over non-DATA statements.

                10 REM ORDER/DATA demo
                20 ORDER 30
                30 DATA 1,9,2,8,3
                40 DATA 7,4,6,5,0
                50 PRINT "Nothing much happening yet"

          4.6.30 OSET value

             Sets the parallel I/O bits  (/P)  to the specified  value.  All
             signals corresponding to 1 bits in the operand  are  activated,
             and all signals corresponding to 0  bits  in  the  operand  are
             deactivated.

          4.6.31 OUT port,value

                Outputs a value to the specified 80x86  I/O  port.  This  is
             used to directly manipulate hardware installed in the PC  which
             is not supported by CAM.

                10 REM Zero LPT1 data port
                20 OUT 956,0
    CAM                                                              Page: 19


          4.6.32 PLAY "filename" [,button_mask [,marker]]

             Plays the indicated file  (".VOC" extension assumed)  through a
             Sound Blaster card.

             If the button_mask parameter is specified, it identifies keypad
             buttons which are allowed to interrupt the file output.  Add up
             the button values from the following table:

                Button1     1       <- Allow button1
                Button2     2       <- Allow button2
                Button3     4       <- Allow button3
                Button4     8       <- Allow button4
                Wait        256     <- Wait for a button before proceeding *
                Immediate   512     <- Don't sound tone/wait till release

             * The  "Wait"  feature will cause playback to pause  after  one
             block until an allowed key is  pressed,  after  which  playback
             will terminate.

             There  are  two  special  "button_mask"   values:   0   invokes
             "sequence" mode,  which uses embedded markers in the file (1-4)
             to stop and wait for a specific keypad  button  to  be  pressed
             before playback proceeds.  A mask value of 16  plays  the  file
             without allowing it to be interrupted by the buttons (default).

             The marker parameter specifies a .VOC file marker at  which  to
             begin playback.  Playing will continue until another marker (or
             the end of the file) is encountered.  The default value (0)  of
             this parameter is to play the entire file. You cannot specify a
             marker parameter without also giving a button_mask parameter.

                10 REM PLAY demo
                20 PLAY "story1",0

          4.6.33 PRINT expression[,expression][,]

             Prints the values of expressions on the console. Either numeric
             values or character strings may be printed.  Unless a  trailing
             ',' is supplied,  PRINT will output a Line-feed/Carriage-return
             to reposition output to a new line after  the  expressions  are
             printed.

             NOTE:  Print  automatically  preceeds  numbers  with  a  space,
             however it  does  no  such  special  processing  for  character
             strings. The STR$ function can be used to convert a number into
             a string and avoid this space.

                10 REM PRINT demo
                20 FOR i=0 TO 10
                30 PRINT "I=",i,"!"
                40 PRINT "I=",STR$(i),"!"
                50 NEXT I
    CAM                                                              Page: 20


          4.6.34 PRINT#unit,expression[,expression],

             Behaves exactly like the PRINT command above  except  that  the
             output is directed to a previously opened file.

                10 REM PRINT#unit demo
                20 OPEN#1,"TEST.FIL","w"
                30 FOR i=0 TO 10
                40 PRINT#1,"I=",I
                50 NEXT I
                60 CLOSE#1

          4.6.35 QDOS "command"

             Quick DOS command. This is the same as 'DOS', except that it is
             faster to execute,  but reduces the memory available to the DOS
             command by more than 128K.  QDOS is  normally  used  for  small
             utilities and DOS internal commands.

                10 REM Perform a directory listing of the directory in A$
                20 QDOS "DIR "+A$

          4.6.36 READ variable[,variable ...]

             Reads data into a variable from DATA statements in the program.
             An ORDER statement must be used to set the data pointer  before
             READ can be used.

                10 REM ORDER/READ/DATA demo
                20 ORDER 60
                30 READ A
                40 PRINT "A=",A
                50 IF A <> 0 THEN 30
                60 DATA 1,9,2,8,3
                70 DATA 7,4,6,5,0

          4.6.37 RETURN

             Returns program execution from a subroutine  to  the  statement
             immediately following the GOSUB that invoked the subroutine.

             RETURN can only be used within a program (non-interactive).

                10 REM Call a subroutine
                20 PRINT "start"
                30 GOSUB 80
                40 PRINT "middle"
                50 GOSUB 80
                60 PRINT "end"
                70 END
                80 PRINT "subroutine"
                90 RETURN
    CAM                                                              Page: 21


          4.6.38 REM

             Inserts a comment in the program.  The remainder of the line is
             ignored by the interpreter.  Execution continues  on  the  next
             line.

             10 REM this is a comment

          4.6.39 RUN [line]

             Starts the program executing.  All user variables  are  cleared
             first.  If a line number is specified then the program will  be
             started at that line,  otherwise execution begins on the  first
             line of the program.

             RUN  can  only  be  used  from  the  interactive  command  line
             (non-program)

                RUN

          4.6.40 SAVE ["name"]

             Saves the program in the specified file.  The extension  ".BAS"
             is assumed.  If no filename is given,  then it's name from  the
             last LOAD or SAVE command issued is assumed.

             SAVE can  only  be  used  from  the  interactive  command  line
             (non-program).

                SAVE "test"

          4.6.41 SAY expression[,expression ...]

             Speaks  the  values  of  the  expressions  using  the  SBTALKER
             text-to-speech driver,  which must be  loaded.  Note  that  the
             VOICE  command  must  be  issued  prior  to  SAY  in  order  to
             initialize the text-to-speech engine.

                10 VOICE 0,5,5,5
                20 SAY "Hello ",N$," Welcome to CAM"

          4.6.42 SCREEN "filename"

             Loads the video text buffer with the contents of the file. This
             may be used to rapidly display  previously  prepared  "slides".
             Video images can be created and edited  with  the  stand  alone
             screen utility.

                10 REM Load a "slide" screen
                20 SCREEN "SLIDE1.SCR"
    CAM                                                              Page: 22


          4.6.43 SOUND frequency

             Generates a tone of the specified frequency via the PC speaker.
             The tone will continue until it is explicitly  turned  off,  or
             another tone is generated.  A frequency value of zero turns off
             the tone.

                10 Generate a 1000hz tone while running a subroutine
                20 SOUND 1000
                30 GOSUB 1000
                40 SOUND 0

          4.6.44 STOP

             Terminate  execution  of  the  program  with  an  informational
             message.

                10 REM End program with an announcement
                20 STOP

          4.6.45 TUNE tune

             Plays a selected short tune  (0-6)  via the PC  speaker.  These
             tunes are of varying length,  and as useful as  "fillers"  when
             waiting for some  other  operation.  The  following  tunes  are
             currently defined:

                #   Name                    Approx time (sec)
                ---------------------------------------------
                0   Simple Up Scale             2
                1   Simple Down Scale           2
                2   Misc. melody #1             2
                3   Misc. melody #2             4
                4   Mary had a little lamb      8
                5   This old man                10
                6   Twinkle-Twinkle             12
                7   Ittsy-Bitsy-Spider          15
                8   Doe-A-Deer                  23

                10 REM Play a little tune
                20 TUNE 1

          4.6.46 VOICE tone,volume,pitch,speed

             Initializes the SBTALKER text-to-speech engine  (which must  be
             loaded prior to starting CAM). The operand values and allowable
             ranges are: (tone: 0=Bass/1=Treble, volume:  0-9,  pitch:  0-9,
             speed: 0-9)

                10 VOICE 0,5,5,5
                20 SAY "Hello ",N$," Welcome to CAM"
    CAM                                                              Page: 23


          4.6.47 MIX <output>,<left-level>[,<right-level>]

             Control the output volume levels of the Sound Blaster 2.0,  Pro
             and 16 mixer hardware. <output> indicates the output channel to
             adjust:

                0 = Master volume
                1 = Voice (digital sound) level
                2 = MIDI (digital music) level
                3 = CD (CD audio) level
                4 = LINE level (SB-PRO and SB16 only)
                5 = MIKE level (SB-PRO and SB16 only)

             The <level> values range from 0 (off) to 31 (full volume). Note
             that the actual number of separate volume steps varies with the
             sound card hardware.  When an output has fewer than 32 physical
             settings,  the 0-31 values are scaled  to  cover  the  physical
             range of the card (ie: 0 is always off, 31 is always maximum).

                SB2.0   = Outputs 0-3 have 8 steps, output 4 has 4 steps.
                SBPRO   = Outputs 0-4 have 8 steps, output 5 has 4 steps
                SB16    = All outputs have 32 steps

             If only one level value is  supplied,  BOTH  channels  (left  &
             right) of the selected output are set to that level.

             The microphone output (5) is mono for all cards,  and is set to
             the <left-level> value.  If a <right-level>  value is supplied,
             it is ignored.

             Sound Blaster 2.0 cards have only a mono mixer,  and  therefore
             always adjust both channels of  ALL  outputs  to  the  supplied
             <left-level> only.

             Additional mixer  features  available  on  some  cards  may  be
             accessed via the DOS/QDOS commands by using  the  command  line
             mixer program included with the card (SBP-MIX, SB16MIX etc.)
    CAM                                                              Page: 24


       4.7 Error Messages

          The following error messages are produced by  CAM.  If  the  error
          occurs during the execution of a program,  it will be followed  by
          "in line n" where n is the offending line unmber.

          4.7.1 Illegal program error

             Results from an attempt to use a  statement  within  a  program
             which is only allowed as an interactive command.

          4.7.2 Illegal direct error

             Results from an attempt to use a  statement  as  an  interactve
             command which is only available within a program.

          4.7.3 Syntax error

             Results from any statement which does not follow the CAM syntax
             rules.

          4.7.4 Line number error

             Results from an attempt to reference a line number  which  does
             not exist

          4.7.5 Wrong type error

             Results from an attempt to use a value in  a  context  where  a
             different type (number or string) is expected.

          4.7.6 Divide by zero error

             Results from an attempt to perform division by zero.

          4.7.7 Nesting error

             Results from incorrect  nesting  of  FOR/NEXT  of  GOSUB/RETURN
             constructs,  or from overflow of  the  internal  control  stack
             which manages these constructs.

          4.7.8 File not open error

             Results from an attempt to perform I/O to a  unit  number  that
             does not have a corresponding open file.

          4.7.9 File already open error

             Results from an attempt to open a file using a unit number that
             already has a corresponding file opened.

          4.7.10 Input error

             Results an incorrect numeric entry  in  response  to  an  input
             request for a numeric variable.
    CAM                                                              Page: 25


          4.7.11 Dimension error

             Results from an attempt to access a numeric array that has  not
             been defined,  or use of an index value that is outside of  the
             range declared for the array.

          4.7.12 Data error

             Results from attempt to READ when the  data  pointer  does  not
             point to a data statement containing the correct data type  for
             the variable you are attempting to use.

          4.7.13 Out of memory error

             Results when CAM's available memory  pool  has  been  used  up.
             Available  memory  is  depleted  by  program  lines,  character
             strings, and numeric arrays.

          4.7.14 Out of range error

             Results from an operand to TUNE or CONTROL which is larger than
             the defined selections for those statements.

          4.7.15 Interface error

             Results from a failure to communicate with attached hardware.

       4.8 Control-C

          CAM uses the keyboard Ctrl-C character  (Press  'C'  while holding
          CTRL)  to signal an ABORT condition.  CAM will stop  it's  current
          activity and return  to  the  interactive  prompt  as  quickly  as
          possible when this key combination is detected.
    CAM                                                              Page: 26


    5. UTILITY PROGRAMS

       5.1 The RENUMBER utility

          In the course of editing and debugging a  CAM  program,  you  will
          find that the line numbers become unsightly,  with gaps where  you
          have deleted lines,  and extra numbers where you have added lines.
          A major problem can occur if you  "use up"  all the  line  numbers
          that you allowed between two lines,  and wish  to  insert  another
          one.

          To solve these problems,  CAM  includes  a  stand  alone  RENUMBER
          utility, which reads a CAM source file,  and writes a new one with
          all the lines renumbered in sequence.  Line number  references  in
          "GOTO", "GOSUB",  "ORDER" and "IF/THEN" statements are adjusted to
          reference the correct new line numbers.

          The syntax of the RENUMBER utility is:

                  RENUMBER oldfile newfile [start [increment]]

          The CAM source is read from  'oldfile',  and the renumbered source
          is written to  'newfile'.  The optional  'start'  and  'increment'
          parameters allow you to  specify  the  first  line  number  to  be
          assigned, and the numerical spacing of the new line numbers. These
          values both default to 10 (ie: start at line 10,  and increment by
          10 for each subsequent line).

          Example:

                   RENUMBER PROGRAM.BAS NEWPROG.BAS 1000 100

          This reads the source  program  from  PROGRAM.BAS,  and  writes  a
          renumbered version to NEWPROG.BAS.  The new program will have line
          numbers starting at 1000, and incrementing by 100 for every line.
    CAM                                                              Page: 27


       5.2 The SOUND utility

          The SOUND utility is a DOS command line program to record and play
          .VOC sound files. It is useful with CAM, because it:

             - Insures .VOC blocks will be less than 64K.
             - Allows .VOC blocks to be split at defined points.
             - Allows markers to be inserted into the file.

          SOUND is invoked with the following command line:

             SOUND [/R /Bsize /D /P /Q /Srate /Ttime] filename ...

          The  '/R'  option indicates that the specified files are to be  be
          recorded, otherwise they are played.

          The '/Bsize' option is effective for recording only,  and sets the
          block size to 'size' (default 65500).

          The '/D'  option causes SOUND to output debugging messages showing
          the status of various internal operations.

          The  '/P'  option causes SOUND to startup in playback or recording
          PAUSE mode.  This requires you to press a key  before  proceeding.
          When recording, this option can be useful if you wish to begin the
          .VOC file with a marker.  Ie: Start in recording-pause mode,  then
          press a key to insert the marker and proceed.

          The '/Q'  option tells SOUND to be QUIET! This inhibits the normal
          startup and progress messages.

          The  '/S'  option is effective for recording only,  and  sets  the
          sampling rate to 'rate' (Default 8000).

          The '/T' option forces a time limit.  SOUND will stop recording or
          playing after this number of 1/18th second intervals.

          When playing a file,  you can press ESC at any time  to  terminate
          playback, or SPACE to pause the output (any other key resumes).

          When recording a file, you can press ESC to stop recording,  SPACE
          to pause recording,  ENTER to force a new block to be started,  or
          1-9 to insert a marker and begin a new block.

          NOTE: Although CAM does not provide it's own recording capability,
          you can record sounds from within CAM by using the DOS command and
          SOUND:

          DOS "SOUND /R /T90 recfile":REM Record 5 seconds to RECFILE.VOC
    CAM                                                              Page: 28


       5.3 The SCREEN utility

          The SCREEN utility program is used to generate text screens  which
          can be rapidly displayed with CAM's  "SCREEN"  command.  Note that
          this does not provide graphical capabilities,  but the use of  the
          PC's graphic character set can provide quite nice looking effects.

          SCREEN in invoked by typeing its name and the name of  the  screen
          file you wish to create/edit as an argument:

                                SCREEN filename

          Once activated, SCREEN provides a number of function keys to allow
          you to position the cursor and select  characters  and  attributes
          for  insertion  into  the  screen.  A   complete   list   of   the
          keys/commands available can be obtained by pressing ALT-F1.

       5.4 The IREDIT utility

          The IREDIT utility is used to record  and  modify  infrared  (I/R)
          control codes for use by the "CONTROL" statement.  It is described
          in more detail in the IR232 documentation file: IR232.TXT

       5.5 The CP290 utility

          The CP290 utility provides a means of controlling X10 devices  via
          the X10 - CP290 computer control  interface.  CP290  can  be  used
          within CAM via the DOS statement. CP290 allows you to turn any X10
          device ON  or  OFF,  as  well  as  to  DIM  lamp  modules.  For  a
          description of the CP290 command,  type CP290 with no operands  at
          the DOS prompt.

       5.6 The MICROCAD utility

          MICROCAD is  a  simple  VGA  resolution  drawing  program.  It  is
          included with the CAM package, mainly to allow viewing/printing of
          the schematic drawing of the IR232 interface,  however it can also
          be used to display or print graphical drawings from within CAM via
          the DOS statement.

          MICROCAD  is  described  in  detail  in  the  documentation  file:
          MICROCAD.TXT
    CAM                                                              Page: 29


    6. SAMPLE APPLICATIONS

       To help you become familier with the CAM system,  we have included  a
       few simple applications.  Note that these do not  use  all  of  CAM's
       capabilities, and as you gain experience with programming the system,
       you will be able to make much more comprehensive  applications  which
       are taylored to your childs particular needs.

       6.1 Main Menu

          This  application  (MENU.BAS)  presents  a  menu  of   the   other
          applications which can be selected to run. This is the focal point
          of the example interface.  All of the other  example  applications
          exit by reloading this menu.

          Note that this implementation  is  set  up  so  that  an  operator
          selects the application which  will  run  for  the  child.  It  is
          entirely possible to design a completely  different  interface  in
          which the child could select applications himself.  This might  be
          suitable as the child becomes more familier with the  system.  The
          possibilities are endless.

       6.2 Sequence training

          This application  (SEQUENCE.BAS)  contains a list of files that it
          will play (in "random order) using the "sequence" mode of the PLAY
          function.  This means that embedded markers within the files cause
          the playback to pause until a specific button is pressed.

          Sequence training can appear as  several  different  applications.
          For example,  a familier story can be recorded  which  pauses  and
          waits for a key every few sentences. This provides a simple method
          to teach the basic operation of the buttons.

          Another  possibility  is  questions  and  answers.  For   example:
          Marker#1 preceeds questions,  and marker#2 preceeds  answers.  Ie:
          Press button 1 and hear  "What does the COW  say?",  then  presses
          button 2 to hear  "Moooo".  Many such questions and answers can be
          stored in a single file.

          Before using this application you must record suitable audio files
          and set the filenames in the  DATA  statements  near  the  end  of
          SEQUENCE.BAS.

       6.3 Story Book

          The story book application  (STORY.BAS)  provides four audio files
          which can be played back by pressing a corresponding button.  This
          gives the child the  satisfaction  of  being  able  to  choose  by
          himself.

          Before using this application,  you  must  record  suitable  audio
          files and set the filenames in the DATA statements near the end of
          STORY.BAS.
    CAM                                                              Page: 30


       6.4 CD Jukebox

          Although originally designed for  a  5-disk  CD  changer,  the  CD
          Jukebox (JUKEBOX.BAS)  works equally well with a TV,  VCR or other
          IR controlled device.  This  application  is  essentially  a  four
          button remote control which can  be  programmed  to  activate  any
          number of functions with the push of a single button.

          This application REQUIRES the IR232 remove control  device  to  be
          operational.

          Before using this application,  you must use the IREDIT utility to
          record suitable control codes for the device in question,  and set
          the  control  codes  in  the  DATA  statements  near  the  end  of
          JUKEBOX.BAS.

       6.5 Joystick Beeper

          Although originally written as a test program, the joystick beeper
          (JBEEP.BAS) can be entertaining to children.  It simply provides a
          variable tone and bar-graph which go up and down with the position
          of the analog input #1.

       6.6 Circle tray

          In this application  (CIRCLE.BAS),  the input buttons are replaced
          with a wooden tray containing  up  to  four  large  circles,  each
          fitted into a hole in the tray.  Handles on the top  of  the  tray
          allow the child to easily remove and replace them. Magnetic "reed"
          switches of the type used in security  systems  close  the  button
          contacts when a circle is inserted into the tray.

          When run,  this application simply informs the child when a circle
          has been successfully inserted or removed,  and then announces the
          number of circles currently in the tray.

       6.7 Note about voice files

          We have not included pre-recorded  voice  ".VOC"  files  with  the
          system, for two reasons:

          A) The child will be most comfortable with the system if the voice
          messages are recorded in a familier voice (Mother, Father, Teacher
          etc.)

          B)  .VOC files are lengthy,  and could  make  the  download  image
          unacceptably large.

          Before running the sample applications which use voice files,  the
          user must first record suitable files.  See the file  VOCFILES.TXT
          for a summary of the required files and their content.

          NOTE:  To increase the response time in  playing  voice  files  on
          older (slower)  systems,  try using FASTOPEN and/or increasing the
          BUFFERS= settings in your CONFIG.SYS file.
    CAM                                                              Page: 31


    7. PC CONNECTIONS AND PINOUTS

       This section shows the connection pinouts and signal  names  for  the
       common PC interfaces.

       All connectors are shows as viewed when looking at the  rear  of  the
       PC.

    7.1 Game connector pin assignments

    +-------------------------------+
    | 8   7   6   5   4   3   2   1 |
     \ 15  14  13  12  11  10   9  /
      +---------------------------+

    1 Game1 +5V           9 Game2 +5V
    2 Game1 switch 1     10 Game2 switch 1
    3 Game1 X position   11 Game2 X position
    4 Game1 Ground       12 Game2 Ground
    5 Game1 Ground       13 Game2 Y position
    6 Game1 Y position   14 Game2 Switch2
    7 Game1 switch 2     15 No connection
    8 No connection

    7.2 Printer connector pin assignments

    +----------------------------------------------------+
    | 13  12  11  10   9   8   7   6   5   4   3   2   1 |
     \  25  24  23  22  21  20  19  18  17  16  15  14  /
      +------------------------------------------------+

          1 -STROBE        * 10 -ACK
          2 DATA 0         * 11 +BUSY
          3 DATA 1         * 12 +PAPER OUT
          4 DATA 2         * 13 +SELECT
          5 DATA 3           14 -AUTO FD
          6 DATA 4         * 15 -ERROR
          7 DATA 5           16 -INIT
          8 DATA 6           17 -SELECT INPUT
          9 DATA 7        18-26 GROUND

    Signals marked with '*' originate from the printer (inputs).
    CAM                                                              Page: 32


    7.3 Serial connector pin assignments

                       PC (25 pin)                              AT (9 pin)
    +---------------------------------------------------+ +-------------------+
    | 1   2   3   4   5   6   7   8   9  10  11  12  13 | | 1   2   3   4   5 |
     \ 14  15  16  17  18  19  20  21  22  23  24  25  /   \  6   7   8   9  /
      +-----------------------------------------------+     +---------------+

        Signal name               Origin   25-Pin(PC)  9-Pin(AT)
        --------------------------------------------------------
        Protective Ground   (GND)   ---         1          1
        Transmit Data       (TXD)   DTE         2          3
        Receive Data        (RXD)   DCE         3          2
        Request To Send     (RTS)   DTE         4          7
        Clear To Send       (CTS)   DCE         5          8
        Data Set Ready      (DSR)   DCE         6          6
        Signal Ground       (GND)   ---         7          5
        Data Carrier Detect (DCD)   DCE         8          1
        Data Terminal Ready (DTR)   DTE        20          4
        Ring Indicator      (RI )   DCE        22          9

    7.4 Keyboard connector pin assignments

    PC/AT DIN-5 connector
          ___ ___
         /   U   \     1 +Clock
       /           \   2 +Data
      |             |  3 -Reset
      |  3       1  |  4 Ground
       \  5     4  /   5 +5 Vdg
         \   2   /
           -----

    PS/2 minature DIN-6 connector
           __ __
         / 6 U 5 \     1 Data
       /           \   2 Reserved
      |  4       3  |  3 Ground
       \           /   4 +5 Vdc
         \ 2   1 /     5 Clock
           -----       6 Reserved

    7.5 Video connector pin assignments

    EGA/CGA/MDA Connector
    +-------------------+   1 Ground         6 Secondary Green/Mono intensity
    | 5   4   3   2   1 |   2 Secondary RED  7 Secondary Blue/Mono video
     \  9   8   7   6  /    3 Red            8 Horizontal sync
      +---------------+     4 Green          9 Vertical sync
                            5 Blue

    VGA Connector
    +---------------------+ 1 Blue      6 Red GND      11 Monitor sense 0
    | 5   4   3   2   1   | 2 Green     7 Green GND    12 Monitor sense 1
    \  10   9   8   7   6 / 3 Red       8 Blue GND     13 Horisontal sync
     \15  14  13  12  11 /  4 Reserved  9 Keying plug  14 Vertical sync
      +-----------------+   5 Ground   10 Ground       15 Reserved
    CAM                                                              Page: 33


    7.6 CP290 Connections (to PC)

    CP290 DIN-5 connector (Viewed at rear of CP290)
          ___ ___
         /   U   \     1 N.C.
       /           \   2 Gnd    - DB-9:5    DB-25:7
      |             |  3 N.C.
      |  3       1  |  4 TxData - DB-9:3    DB-25:2
       \  5     4  /   5 RxData - DB-9:2    DB-25:3
         \   2   /
           -----
    CAM                                                              Page: 34


    Dunfield Development Services (DDS) offers software and firmware
    development services specializing in systems and embedded applications.
    For more information, visit: http://www.dunfield.com
