[plt-scheme] Reading voltages on a serial port...

From: Richard Cleis (rcleis at mac.com)
Date: Sat Aug 5 02:24:03 EDT 2006

I wrote a C program, tested it, then made an extension for MzScheme.  
Maybe there is an easier way, but I wanted to learn how to make an 
extension anyway.  Webpages like

http://www.easysw.com/~mike/serial/serial.html#5_1_1

show how to get and set the control signals in POSIX systems.

rac



On Aug 5, 2006, at 12:07 AM, geb a wrote:

> Maybe this is way off topic but here goes... What I
> would like to do is to read the voltage of a pin on
> the serial port so that if the pin reads high it
> returns a boolean value (positive or negative logic is
> fine).
>
> Can someone point me in the right direction?  The
> following program yields nothing when run...
>
> (define serial (open-input-file "/dev/ttyS0"))
>
> (define (read-loop in-port)
>   (display (read-line in-port))
>   (newline)
>   (read-loop in-port))
>
> (read-loop serial)
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
> _________________________________________________
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme



Posted on the users mailing list.