From owner-freebsd-usb@FreeBSD.ORG Sun Oct 11 17:35:50 2009 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5FACD1065676 for ; Sun, 11 Oct 2009 17:35:50 +0000 (UTC) (envelope-from tlb@tlb.org) Received: from anybots.com (mail.anybots.com [64.142.12.96]) by mx1.freebsd.org (Postfix) with SMTP id 1EC9A8FC14 for ; Sun, 11 Oct 2009 17:35:49 +0000 (UTC) Received: (qmail 97834 invoked from network); 11 Oct 2009 17:35:49 -0000 Received: from unknown (HELO ?10.10.10.66?) (10.10.10.66) by 10.10.10.20 with SMTP; 11 Oct 2009 17:35:49 -0000 Message-Id: <8CA5CC87-EA53-4055-9747-D23B1F853537@tlb.org> From: Trevor Blackwell To: Sven Hazejager In-Reply-To: <09101118515750.-1077948416@somehost.domainz.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Date: Sun, 11 Oct 2009 10:35:49 -0700 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> X-Mailer: Apple Mail (2.935.3) Cc: freebsd-usb@freebsd.org Subject: Re: Simple manner to read 1-pin high/low from USB under FBSD? X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Oct 2009 17:35:50 -0000 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"