about my second comedi program

hello
Im reading the comedilib handbook, but when I tried to
compile the second example program I got this.. please
some help

root_at_peri3:/usr/src/comedi_examples# gcc prog2.c
-lcomedi -o prog2
prog2.c: In function `main':
prog2.c:23: error: dereferencing pointer to incomplete
type
prog2.c:25: warning: passing arg 2 of `comedi_to_phys'
makes pointer from integer without a cast
prog2.c:25: error: too many arguments to function
`comedi_to_phys'
root_at_peri3:/usr/src/comedi_examples# 

this is the program:

#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 = 0;           /* more on this later */

int main(int argc,char *argv[])
{
  comedi_t *cf;
  int chan=0;
  lsampl_t data;
  int maxdata,rangetype;
  double volts;

  cf=comedi_open("/dev/comedi0");

  maxdata=comedi_get_maxdata(cf,subdev,chan);

  rangetype=comedi_get_rangetype(cf,subdev,chan);

 
comedi_data_read(cf->fd,subdev,chan,range,aref,&data);

  volts=comedi_to_phys(data,rangetype,range,maxdata);

  printf("%d %g\n",data,volts);

 return 0;
}

thanks

Angelica.


      ____________________________________________________________________________________
¡Sé un mejor ambientalista!
Encuentra consejos para cuidar el lugar donde vivimos.                       
http://mx.yahoo.com/promos/mejorambientalista.html

Received on 2007-09-21Z14:11:44