38
Wildcat (BL2000)
4.2 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\BL2000
folder provides sample programs specific to the BL2000. 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), compile it using
the
Compile
menu, and then run it by selecting
Run
in the
Run
menu. The BL2000 must
be in
Program
mode (see Section 3.8, “Programming Cable,”) and must be connected to a
PC using the programming cable as described in Section 2.1, “BL2000 Connections.”
More complete information on Dynamic C is provided in the
Dynamic C User’s Manual
.
4.2.1 General BL2000 Sample Programs
•
BOARD_ID.C
—This program is used to identify the model of BL2000 being used, and
displays that information in the
STDIO
window.
•
COUNTLEDS.C
—This program will count from 0 to 31 in binary, using the four gen-
eral-purpose LEDs, DS4–DS7, and the Processor Bad LED, DS8. The LEDs are used
in reverse logical order to minimize the cycling of the relay, which is slaved to the same
output as DS4
.
•
LEDS_4.C
—This program creates four “devices” (lights), and four buttons to toggle
them. Users can view the devices with their Web browser, and change the status of the
lights. If the Demonstration Board is connected to the BL2000, the lights on the Dem-
onstration Board will match the ones on the Web page. See Appendix D for hookup
instructions for the Demonstration Board.
4.2.2 Digital I/O
The following sample programs are found in the
IO
subdirectory in
SAMPLES/BL2000
.
•
ANADIGIN.C
—Demonstrates using the A/D converter channels as digital inputs. You
will be able to see an input channel toggle HIGH and LOW when pressing the pushbut-
tons on the Demonstration Board. See Appendix D for hookup instructions for the
Demonstration Board.
•
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. See Appendix D for hookup instructions for the Demon-
stration Board.
•
DIGOUT.C
—Demonstrates the use of the high-current outputs. Using the Demonstra-
tion Board, you can see an LED toggle on/off via a high-current output. See Appendix
D for hookup instructions for the Demonstration Board.
•
LED.C
—Demonstrates how to toggle the output LEDs on the BL2000 on/off.
Summary of Contents for BL2020
Page 38: ...34 Wildcat BL2000...
Page 84: ...80 Wildcat BL2000...
Page 88: ...84 Wildcat BL2000...
Page 92: ...88 Wildcat BL2000...
Page 94: ......