From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: upro Newsgroups: gmane.emacs.help Subject: Re: Controlling an external device with elisp Date: Mon, 05 May 2003 10:13:40 +0200 Organization: Slackers Home Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <873cjtzu8b.fsf@gmx.net> References: <87u1cazl6v.fsf@gmx.net> <87r87epk39.fsf@gmx.net> <87d6iyru0q.fsf@cs.uga.edu> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1052123577 15329 80.91.224.249 (5 May 2003 08:32:57 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 5 May 2003 08:32:57 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Mon May 05 10:32:53 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19CbKS-0003nY-00 for ; Mon, 05 May 2003 10:28:08 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 19CbHp-0003Tl-03 for gnu-help-gnu-emacs@m.gmane.org; Mon, 05 May 2003 04:25:25 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!logbridge.uoregon.edu!news-FFM2.ecrc.net!fu-berlin.de!uni-berlin.de!212.66.65.26!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 60 Original-NNTP-Posting-Host: 212.66.65.26 Original-X-Trace: fu-berlin.de 1052122850 16109872 212.66.65.26 (16 [172438]) Os: Slackware Linux 2.4.19 User-Agent: Gnus/5.1001 (Gnus v5.10.1) Emacs/21.3 (gnu/linux) Cancel-Lock: sha1:9nHyTYDB2PwEGLFxotcO0Q+D+Ok= Original-Xref: shelby.stanford.edu gnu.emacs.help:112778 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:9273 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:9273 Ed L Cashin writes: > upro writes: > >> Jonas Steverud writes: >> >>> upro writes: >>> >>>> Now this might be a strange question, but is it possible to control an >>>> external device, through parallel or serial port, using elisp as >>>> programming language? >>> >>> It should be possible if the device has a text-based protocol and >>> supports a tcp/ip connection. Gnus, which I use right now, does that >>> to my ISP's newsserver. >>> >>> But if you mean on a lower level, if the device is stupid, like an >>> thermometer or simple motor; I do not know. >>> >>> Depends on the device, a bit. >> >> Hi Jonas, what I meant was indeed a "stupid" device, like a selfmade >> small circuit to switch on a light or somolar (as seen in the Coffee >> mini-HOWTO). >> >> Do you think this is impossible? > > No, it's perfectly possible. The thing is that you can *use* the > device from emacs but ultimately talking to hardware is a kernel > thing. Assuming Linux, as your reference to the Coffee mini-HOWTO > would suggest, your choices are to ... > > * build the circuit to recognize codes you can send using an > existing driver > > e.g., you could put the device on your first serial port and > control it from emacs by writing strings like "please turn on the > light" or numbers like 101 to /dev/ttyS0. > > or > > * use IO primitives or write your own driver as suggested in the > Coffee mini-HOWTO Are these IO primitives in C? I don't really understand this. I prefer the second suggestion, since I have very few knowledge of how to build circtios (not to speak of how to recognize signals...) Thank You In Advance! > > The former option is probably a lot easier in software; the latter is > probably easier for you in terms of circuit design. -- Michael r-znvy: zvpunry.wryqra jro.qr (chg gur "@" jurer vg svgf...) ab fcnz cyrnfr