Don't use debhelper
[comedilib.git] / demo / README
1
2 GETTING STARTED:
3
4 After installing comedi and comedilib, cd to this directory (comedilib*/demo).
5
6 Use ./info for a very first test. If hardware and software are correctly
7 installed, the program prints a list of subdevices it recognises. If the
8 device is not /dev/comedi0, use here and in the following the command-line
9 option -f <device>.
10
11 Continue with ./inp -s <subdevice> -c <channel> to read individual samples,
12 and with ./outp -s <subdevice> -c <channel> <integer value> to set an
13 output value.  Other beginning demos are: cmd, dio, inpn, tut1, tut2.
14 You should understand how these work before trying to understand the
15 other demos.
16
17 The perl subdirectory contains a few examples for the perl wrapper.
18
19
20 DEMO PROGRAMS:
21
22 ao_waveform:
23         You need a device (and driver) capable of streaming analog output,
24         which currently is some of the members of the NI AT-MIO and PCI-MIO
25         E series.  Creates a sine wave on an analog output channel.
26
27 common:
28         This is not an example.  The file common.c just contains some code
29         that is common to many of the examples.
30
31 cmd: 
32         An example for directly using Comedi commands.  Comedi commands
33         are used for asynchronous acquisition, with the timing controlled
34         by on-board timers or external events.
35  
36 dio:
37         Requirements:  A board with a digital I/O subdevice.  Not just
38         a 'digital input' or 'digital output' subdevice, but one in
39         which the channels can be configured between input and output.
40
41 eeprom_dump:
42         Dumps the EEPROM of a card, if it has one.  Useful for debugging
43         devices/drivers.
44
45 info:
46         Displays some information that Comedi knows about a device.
47
48 inp:
49         Simple input:  Reads one sample from one channel on one subdevice.
50
51 inpn:
52         Slightly more complicated input demo.  (It has a for() loop.)
53         Reads each channel on a subdevice, at every possible input
54         range, and converts the data to a voltage.
55
56 insn:
57         Example showing how to use instructions directly. Not
58         recommended for beginners: use higher-level functions such
59         as comedi_data_read(), comedi_data_write(), etc., as demonstrated
60         in the inp, outp, and dio examples.  
61         
62 ledclock:
63         This demo requires a Fantazein clock modified to be directly
64         controlled by the parallel port on a computer.  The original
65         demo used a real-time task and controlled the parallel port
66         directly.  This version is not complete.
67
68 mmap:
69         This example shows how to map the internal Comedi buffer
70         and directly access samples instead of using read() and
71         write().
72
73 outp <value>:
74         Write one <value> to one channel of one subdevice.  Requires
75         a digital or analog output subdevice.
76
77 receiver:
78         This demo is meant to be used in conjunction with the sender
79         demo.  Receiver requires a digital input subdevice, and sender
80         requires a digital output subdevice.  When the clock and data
81         pins are connected between the sending and receiving devices,
82         one should be able to send bits over the link.
83  
84 select:
85         An example for using select() with asynchronous input.  This
86         example requires an asynchronous input subdevice that can
87         handle TRIG_TIMER as a scan_begin_src.
88
89 sender:
90         See receiver.
91
92 sigio:
93         Similar to the cmd demo.  This demo sets up a signal handler
94         for SIGIO, which is called whenever data is ready to be read
95         from the device.
96
97 sv:
98         Similar to inp, but measures the input using the comedi_sv_*()
99         functions, which average many samples to try to get a more accurate
100         estimate of the actual input.
101
102 tut1:
103 tut2:
104         Tutorial examples.  See the Comedilib documentation.
105
106
107 COMMAND-LINE OPTIONS:
108
109 Many of these demos are linked with the file common.c, which parses
110 command line options.  Some options don't make sense with all programs.
111 The options are:
112
113   -a <aref>     use analog reference <aref> (default: 0 == ground)
114   -c <chan>     use channel <chan> (default: 0)
115   -s <subd>     use subdevice <subd> (default: 0)
116   -r <index>    use voltage range <index> (default: 0)
117   -f <file>     use device file <file> (default: /dev/comedi0)
118   -n <value>    use <value> for the number of channels in a scan
119   -N <value>    use <value> for the number of scans
120   -F <freq>     use <freq> as the scan frequency
121   -v            verbose
122   -d            set analog reference to differential
123   -g            set analog reference to ground
124   -o            set analog reference to other
125   -m            set analog reference to common
126