insert usleep() in loop
[comedilib.git] / demo / tut1.c
1 /*
2  * Tutorial example #1
3  * Part of Comedilib
4  *
5  * Copyright (c) 1999,2000 David A. Schleef <ds@schleef.org>
6  *
7  * This file may be freely modified, distributed, and combined with
8  * other software, as long as proper attribution is given in the
9  * source code.
10  */
11
12 #include <stdio.h>      /* for printf() */
13 #include <comedilib.h>
14
15 int subdev = 0;         /* change this to your input subdevice */
16 int chan = 0;           /* change this to your channel */
17 int range = 0;          /* more on this later */
18 int aref = AREF_GROUND; /* more on this later */
19
20 int main(int argc,char *argv[])
21 {
22         comedi_t *it;
23         int chan=0;
24         lsampl_t data;
25         
26         it=comedi_open("/dev/comedi0");
27         
28         comedi_data_read(it,subdev,chan,range,aref,&data);
29         
30         printf("%d\n",data);
31         
32         return 0;
33 }
34