User`s manual
52 eDisplay (OP7200)
4.3 Sample Programs
Sample programs are provided in the Dynamic C SAMPLES folder. The sample program
PONG.C demonstrates the output to the STDIO window. The various directories in the
SAMPLES folder contain specific sample programs that illustrate the use of the correspond-
ing Dynamic C libraries.
The SAMPLES\OP7200 folder provides sample programs specific to the OP7200. Each
sample program has comments that describe the purpose and function of the program. Fol-
low the instructions at the beginning of the sample program.
To run a sample program, open it with the File menu (if it is not still open), then compile
and run it by pressing F9 or by selecting Run in the Run menu. The OP7200 must be in
Program mode (see Section 3.10) and must be connected to a PC using the programming
cable as described in Section 2.3.
More complete information on Dynamic C is provided in the Dynamic C User’s Manual.
4.3.1 General OP7200 Sample Programs
The following sample programs are found in the SAMPLES\OP7200 directory.
• BOARD_ID.C—Detects the model of the board you are using and displays the informa-
tion in the
STDIO window.
• FUN.C—Demonstrates the features of the OP7200. A variable customer-supplied 0–10 V
DC power supply is recommended to demonstrate the analog input section.
4.3.2 Digital I/O
The following sample programs are found in the IO subdirectory in SAMPLES\OP7200.
• BUZZER.C—Demonstrates the use of the OP7200 buzzer.
• DIGIN.C—Demonstrates the use of the digital inputs. Using the Demonstration Board,
you can see an input channel toggle from HIGH to LOW when pressing a pushbutton
on the Demonstration Board.
• DIGOUT.C—Demonstrates the use of the high-current outputs configured as either
sinking or sourcing outputs. Using the Demonstration Board, you can see an LED
toggle on/off via a high-current output.
• LED.C—Toggles the LEDs on the OP7200.
• PWM.C—Demonstrates the use of Timer B to generate a 42 Hz PWM signal on digital
output OUT0. The PWM duty cycle may be adjusted from 1 to 99%. Connect +K to
+PWR (pins 1 and 3 on screw-terminal header J3) to run this sample program.
• TRISTATE.C—Demonstrates the use of the high-current outputs configured as sink-
ing, sourcing, or tristate outputs. Using the Demonstration Board, you can see a bank of
channels toggle the corresponding LEDs on/off via the high-current outputs.