User`s manual

RabbitFLEX User’s Manual www.rabbit.com 65
6. APPLICATIONS PROGRAMMING
Programming your customized RabbitFlex board has been made both adaptable and as simple as possible.
The complexity of dealing with multiple hardware configurations has been hidden in the use of data struc-
tures in the Flex libraries. A number of sample programs are provided to illustrate the new data structures
and supporting software as well as to use for templates for your own application development.
In Section 6.4 a software walk-through is provided for the sample program speakertone.c with modi-
fications to increase its functionality.
6.1 RabbitFLEX Sample Programs
This section summarizes sample programs specific to the RabbitFLEX BL300F. They are located in the
/Samples/RabbitFlex_BL300F folder (formerly named /Samples/RabbitFlex_SBC40)
where you installed Dynamic C.
Table 6-1. RabbitFLEX BL300F Sample Programs
Program Name Description
anain_avg_simple.c
Continuously samples one user-specified analog input pin, displaying in
the Stdio window both the raw data from the analog signal and also
“averaged” raw data, meaning that noise and error are removed using a
weighted value. Both the raw data and the averaged raw data are
converted to volts. These values are also displayed.
anain_calibrate.c
Displays all analog inputs, prompting you to choose one of them to
calibrate, along with its low and high voltages. This sample overwrites
the factory calibration.
anain_simple.c
Continuously reads user-specified analog input pin, displaying both its
raw value and its converted voltage value.
anain_4_20_simple.c
Continuously reads a user-specified 4-20 mA analog input pin and
displays both its raw value and its converted amperage value.
anaout_calibrate.c
Calibrate analog out pins. Requires you to measure output voltages.
This sample overwrites the factory calibration.
anaout_simple.c
Accepts a raw value or voltage from the user and outputs it to the analog
out pin selected at compile time.
digin_simple.c Display the value of a digital input.
digin_groups.c
Demonstrates software grouping capability. Displays all digital inputs,
then prompts for which inputs to group together.
digout_simple.c Display the value of a digital output.