Re: Reading from Paralell Port

Hi Daniel,
Thanks for the answer. Yes I do.
Cheers,
Francisco Mota

PS. The code is below

=================
#include <math.h>
#include <stdio.h>
#include <unistd.h>
#include <comedilib.h>

int subdev = 0;
int chan = 0;
//int range = 0;
int aref = AREF_GROUND;

int main()
{
  comedi_t *it;
  unsigned int in=0; // unsigned
  int test=0;

it=comedi_open("/dev/comedi0");
 
comedi_dio_config(it, subdev, chan, COMEDI_INPUT); 
 
 test=comedi_dio_read(it, subdev, chan,&in);
 
 printf("%d %d\n", test,in);

 return 0;

}
============================
Daniel Nilsson wrote:

>On Tue, Feb 14, 2006 at 03:25:04PM +0000, Francisco Mota wrote:
>  
>
>>Hello all,
>>
>>I am using comedi for controlling a stepper motor through parallel port. 
>>The point is that the comedi "write" command works fine, but I am having 
>>hard time in reading from it (I always get "1"). Has anyone experienced 
>>that problem?
>>    
>>
>
>Just checking, are you calling comedi_dio_config to set the direction
>to input before reading the port?
>
>Regards
>  
>

Received on 2006-02-14Z16:34:24