chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Opening a TTY from chicken


From: Aaron Patterson
Subject: Re: [Chicken-users] Opening a TTY from chicken
Date: Thu, 5 Jul 2012 11:19:07 -0700
User-agent: Mutt/1.5.21 (2010-09-15)

On Fri, Jun 22, 2012 at 06:27:32PM -0700, Aaron Patterson wrote:
> Hi everyone!
> 
> I'm trying to open a tty from chicken (so that I can read data from my
> meat curing box).  The stty egg seems to be the one I want, but whenever
> I try to create a new port, chicken just blocks.
> 
> Here is my program:
> 
>   (open-input-file "/dev/tty.uart-AEFF467AF9D70234")
> 
> I've made a video of what happens:
> 
>   http://www.youtube.com/watch?v=StlwI0nC_pc
> 
> Any help would be greatly appreciated!

Replying to myself because I figured it out.  It turns out that I need
to open the file with open/nonblock, and enable blocking reads on the
file descriptor.

Here is a link to my complete program:

  https://gist.github.com/3055113

I made a short video of the program in action:

  http://www.youtube.com/watch?v=Oq1vkMrGJQs

I have two sensors hooked to my micro controller.  Both provide relative
humidity and temperature information.  One is mounted inside my meat curing
box, and the other is outside (so I can gather ambient temperature data).

The left pair is the RH and temp (in degrees C) on the internal sensor,
the right pair is the RH and temp for the external one.  You can see the
values on the right increase when I blow on the sensor.

<3<3<3<3<3

-- 
Aaron Patterson
http://tenderlovemaking.com/

Attachment: pgpuwGVWzmBlB.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]