Overview of Coach Programming

Coach Software uses a version of the 'Basic' programming language in order to control devices, and to teach programming.  The Coach language has the normal compliment of commands and built in functions including the ability to create and call functions and procedures, create modular programs, and pass variables from one program structure to another.  The output of any sensor can be used as a variable to control programs.  Programs can also activate outputs on appropriate hardware such as the CoachLab II interface panel in order to control "actuators" such as motors, lights, buzzers, relays, solenoids, muscle wire, etc. 

The Coach programming environment can be used by students of varying levels of sophistication and computer knowledge.  The Coach software authoring environment lets you create activities for students in which you can pre-define functions, procedures, variables, or sections of code.  In this way it is possible for beginning students to work with blocks of code that they could not yet create themselves and interact with it in order to change components or learn the function or logic behind a particular algorithm.  It is also possible for students or instructors to create their own code entirely from scratch using basic commands. 

Coach Basic does not encourage the "goto" command or other spaghetti coding techniques but instead uses a structure similar to languages such as Pascal.  Programs can be as simple or complicated as desired including performing complicated mathematical manipulations.  The Coach language, following the rules of "basic" also assists students as they enter the real world and begin to program on other systems and languages.

There are four modes of programming available within Coach software.

Manual control mode
Students can read connected sensors and switch actuators on and off  by simple clicking to study their behavior.

Instruction mode
Students can build programs by manually controlling a  model via  'Instruction buttons' on the screen. Each press of a pre-defined button adds a corresponding line of code to the program.  These code lines can then be executed in order as a program.  Students learn that models can be controlled with written commands.

Micro-world programming mode
A micro-world consists of a predefined set of commands tuned to a particular model. Students learn to write control programs by selecting statements from a command list on the screen. Each statement is written in easy to understand script like "Turn_Right"

Advanced programming mode
Experienced students can program freely by choosing commands from a complete list of available Coach Language commands or by typing commands free form. It is also possible to make custom commands and add these to the standard list of programming commands.

Programming in Coach 5

The editor used to write Coach Basic programs has built in syntax checking tools that prompt beginning students for the correct answer to questions and help save time in the classroom.  If simple syntax errors are present in code then the program will alert you to their presence, location, and in many cases how to correct the problem.  This keeps simple typos and other mistakes from taking up the student or teacher's valuable time. 

Coach programs can also be executed within a monitor window.  This helps students understand the flow within a program as well as letting them monitor the value of variables as a program progresses.  This is a powerful debugging tool and helps student spot faulty logic, or infinite loops in no time.   The monitor can be be adjusted to manually step through each line of code, or can execute code in order based on a slider that controls the speed at which the commands are executed.