Re: Easy example for analog out needed, please

I'm sure somebody else will get back to you with a "better/complete"
example.

But I like to point out a few things to you:

firstly. Are both comedi and comedilib installed correctly?
Did you do a comedi_setup so that /dev/comedi0 is linked to the device -
did this success?

Then it is fairly simple.

You need a comedi_open
and then you can do comedi_data_write

use comedi_find_subdevice_by_type to find the subdevice number.

in the comedilib/demo dir there is a program outp.c
This is more or less the simplest example out there.
Offcourse this one works with parameters - hardcoding will make code
shorter maybe :)
I'm sure you'll manage.



On Thu, 2007-09-20 at 12:59 +0000, Johannes wrote:
> Hi Comedi Users,
> 
> I read the comedi doc a couple of times and tried the examples of
> comedilib, but I still dont understand how to make the analog out working,
> so I dont know how to write a program that simply set the analog out.
> I know I have to use comedi_data_write, but how exactly do I set the value
> for the output.
> I also have no clue how the data type lsampl_t works.
> 
> Does anybody have a short and easy example?
> 
> Regards
> 
> PS: I got digital in/out working just fine
> 
> ---------------------------------------------
> Free POP3 Email from www.Gawab.com 
> Sign up NOW and get your account _at_gawab.com!!
> 
> _______________________________________________
> comedi mailing list
> comedi_at_comedi.org
> https://mail.comedi.org/cgi-bin/mailman/listinfo/comedi

Received on 2007-09-20Z12:22:48