From owner-freebsd-hackers Mon Oct 28 5:56:45 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 98B2E37B401 for ; Mon, 28 Oct 2002 05:56:43 -0800 (PST) Received: from littleboy.csh.rit.edu (littleboy.csh.rit.edu [129.21.60.12]) by mx1.FreeBSD.org (Postfix) with ESMTP id D5AFF43E42 for ; Mon, 28 Oct 2002 05:56:42 -0800 (PST) (envelope-from sunday@csh.rit.edu) Received: from fury.csh.rit.edu (fury.csh.rit.edu [129.21.60.5]) by littleboy.csh.rit.edu (Postfix) with ESMTP id B7469866A; Mon, 28 Oct 2002 08:56:36 -0500 (EST) Received: by fury.csh.rit.edu (Postfix, from userid 38501) id 13AAE2E384; Mon, 28 Oct 2002 08:56:35 -0500 (EST) Date: Mon, 28 Oct 2002 08:56:35 -0500 From: Joe Sunday To: David Nicholas Kayal Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: i am looking for a 5 volt signal Message-ID: <20021028135635.GA28293@csh.rit.edu> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4i X-Operating-System: SunOS 5.8 (sun4u) Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sun, Oct 27, 2002 at 09:12:33AM -0800, David Nicholas Kayal wrote: > I'm looking for a 5 volt signal. > > I have wires plugged into pins 2 and 25 of the parallel port. > > I have written a small program: > > #include > #include > #include > > int main() > { > int fd; > while(1) > { > ioctl(fd, PPISDATA, 255); > } > } PPISDATA actually takes an int* argument. (The man page may be a tad confusing here.) Try int main() { int fd; int d = 255; fd = open( "/dev/ppi0", O_RDWR ); ioctl( fd, PPISDATA, &d ); return 0; } The port should hold the last value you send to it, there's no need to continually refresh it. --Joe -- Joe Sunday http://www.csh.rit.edu/~sunday/ Computer Science House, Rochester Inst. Of Technology To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message