Specifications
Comedi
8 / 148
ranges:
all chans: [0,1]
command:
not supported
This board has four subdevices. Devices are separated into subdevices that each have a distinct purpose; e.g., analog input, analog
output, digital input/output.
Here’s the information from Comedi’s /proc/comedi file, which indicates what drivers are loaded and which boards are
configured:
cat /proc/comedi
comedi version 0.7.76
format string: "%2d: %-20s %-20s %4d",i,driver_name,board_name,n_subdevices
0: usbduxsigma usbduxsigma 4
usbduxfast:
usbduxfast
usbduxsigma:
usbduxsigma
This documentation feature currently returns the driver name, the device name, and the number of subdevices. Following those
lines are a list of the Comedi kernel driver modules currently loaded, each followed by a list of the board names it recognizes
(names that can be used with comedi_config).
3 Writing Comedi programs
This section describes how Comedi can be used in an application, to communicate data with a set of Comedi devices. Section 4
gives more details about the various acquisition functions with which the application programmer can perform data acquisition
in Comedi.
Also don’t forget to take a good look at the demo directory of the Comedilib source code. It contains lots of examples for the
basic functionalities of Comedi.
3.1 Your first Comedi program
This example requires a card that has analog or digital input. This progam opens the device, gets the data, and prints it out:
/
*
*
Tutorial example #1
*
Part of Comedilib
*
*
Copyright (c) 1999,2000 David A. Schleef <ds@schleef.org>
*
*
This file may be freely modified, distributed, and combined with
*
other software, as long as proper attribution is given in the
*
source code.
*
/
#include <stdio.h> /
*
for printf()
*
/
#include <comedilib.h>
int subdev = 0; /
*
change this to your input subdevice
*
/
int chan = 0; /
*
change this to your channel
*
/
int range = 0; /
*
more on this later
*
/
int aref = AREF_GROUND; /
*
more on this later
*
/
int main(int argc,char
*
argv[])