Date: Sun, 11 Oct 2009 10:35:49 -0700 From: Trevor Blackwell <tlb@tlb.org> To: Sven Hazejager <sven@hazejager.nl> Cc: freebsd-usb@freebsd.org Subject: Re: Simple manner to read 1-pin high/low from USB under FBSD? Message-ID: <8CA5CC87-EA53-4055-9747-D23B1F853537@tlb.org> In-Reply-To: <09101118515750.-1077948416@somehost.domainz.com> References: <0910111122164F.-1077952704@somehost.domainz.com> <200910111217.49002.hselasky@c2i.net> <09101116183255.-1077948416@somehost.domainz.com> <200910111639.07588.hselasky@c2i.net> <09101118515750.-1077948416@somehost.domainz.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Try Phidgets. http://phidgets.com. It's easy to read digital signals as a HID device. You can get started with not much more than: fd=open("/dev/uhidN",...) while (1) { char buf[8]; read(fd, buf, 8); int input_signal = (buf[X]>>Y)&1; printf("%d\n", input_signal) } for some values of N, X and Y. You can get more general if you want. -- Trevor Blackwell 650 776 7870 tlb@tlb.org On Oct 11, 2009, at 9:56 AM, Sven Hazejager wrote: > On Sun, 11 Oct 2009, Hans Petter Selasky wrote: > >>> Thanks for your reply, would I need some GPIO device like this: >>> http://www.fivemanconspiracy.com/node/45 >> >> I don't know. You need to ask the manufacturer. Ask them if the >> control >> endpoint is used to turn on/off the pin(s) you want. > > Well, I only need to read high/low, not to set anything... I've > mailed the manufacturer for info, thanks for suggesting. > > Sven > _______________________________________________ > freebsd-usb@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-usb > To unsubscribe, send any mail to "freebsd-usb-unsubscribe@freebsd.org"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?8CA5CC87-EA53-4055-9747-D23B1F853537>