From owner-freebsd-questions@FreeBSD.ORG Wed Jun 11 23:44:20 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7E72137B401 for ; Wed, 11 Jun 2003 23:44:20 -0700 (PDT) Received: from mail.cs.ait.ac.th (mail.cs.ait.ac.th [192.41.170.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id EDE2743FBD for ; Wed, 11 Jun 2003 23:44:18 -0700 (PDT) (envelope-from Olivier.Nicole@ait.ac.th) Received: from bazooka.cs.ait.ac.th (on@bazooka.cs.ait.ac.th [192.41.170.2]) by mail.cs.ait.ac.th (8.12.3/8.9.3) with ESMTP id h5C6iB7F051934; Thu, 12 Jun 2003 13:44:15 +0700 (ICT) From: Olivier Nicole Received: (from on@localhost) by bazooka.cs.ait.ac.th (8.8.5/8.8.5) id NAA24236; Thu, 12 Jun 2003 13:44:10 +0700 (ICT) Date: Thu, 12 Jun 2003 13:44:10 +0700 (ICT) Message-Id: <200306120644.NAA24236@bazooka.cs.ait.ac.th> To: bernard.dugas@is-production.com In-reply-to: <3EE79ED4.93DB9224@is-production.com> (message from Bernard Dugas on Wed, 11 Jun 2003 23:27:49 +0200) X-Virus-Scanned: by amavisd-milter (http://amavis.org/) cc: freebsd-questions@freebsd.org Subject: Re: how to talk to the serial and parallel ports through a C X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jun 2003 06:44:20 -0000 I'll reply on the parallel port: fd_relay=open("/dev/ppi0", O_WRONLY); ioctl(fd_relay, PPISDATA, value) Value being an 8 bits value. That works wonders with the relay card from Quality Kits http://www.qkits.com/serv/qkits/diy/pages/QK74.asp As for the entry, as I only needed 2 contacts, I used mouse button (plus it provides a nice testing interface, just click on your mouse buttons :) Olivier