From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Ed L Cashin Newsgroups: gmane.emacs.help Subject: Re: Controlling an external device with elisp Date: Sun, 04 May 2003 22:45:25 -0400 Organization: negia.net Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <87d6iyru0q.fsf@cs.uga.edu> References: <87u1cazl6v.fsf@gmx.net> <87r87epk39.fsf@gmx.net> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1052103189 30742 80.91.224.249 (5 May 2003 02:53:09 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 5 May 2003 02:53:09 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Mon May 05 04:53:06 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 19CW5b-0007yF-00 for ; Mon, 05 May 2003 04:52:27 +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 19CW47-0003s2-02 for gnu-help-gnu-emacs@m.gmane.org; Sun, 04 May 2003 22:50:55 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!sn-xit-03!sn-xit-06!sn-post-01!supernews.com!corp.supernews.com!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.090014 (Oort Gnus v0.14) Emacs/21.2 (i386-debian-linux-gnu) Cancel-Lock: sha1:bx0wxIeyrpUfggl22yKdPF2mHa4= Cache-Post-Path: alpha.negia.net!unknown@ppp63-172-85-115.silverstreakdsl.com X-Cache: nntpcache 2.4.0b5 (see http://www.nntpcache.org/) Original-X-Complaints-To: abuse@supernews.com Original-Lines: 47 Original-Xref: shelby.stanford.edu gnu.emacs.help:112770 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:9265 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:9265 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 The former option is probably a lot easier in software; the latter is probably easier for you in terms of circuit design. -- --Ed L Cashin PGP public key: http://noserose.net/e/pgp/