[TriLUG] C linux programming question

Jon Carnes jonc at nc.rr.com
Fri May 23 21:41:35 EDT 2003


Ed Hill is the guy you want to talk to (see the archives from last week),
but this is definitely do-able.  I used to do it using assembler but it
should work fine in C as well (or you can write an assembler subroutine to
monitor the voltage).

Note: unless you get an A/D card of some kind you are only going to know 0
or 1 and not any actual voltage values - or guesstamates.

Jon Carnes
----- Original Message -----
From: "Greg Brown" <gregbrown at mindspring.com>
To: <trilug at trilug.org>
Sent: Friday, May 23, 2003 8:57 PM
Subject: [TriLUG] C linux programming question


> Hey all.  Is it possible, using C, to monitor voltage on one pin of a
> serial port when voltage is supplied from an outside source or do I
> have to knuckle under and learn some assembly for this task?  What I'm
> after here is with an embedded linux machine mounted in a car and I
> want to have power supplied by an always-on supply in the car.  I'd
> also like to have a pin on a serial port connected to a "only on when
> running" wire (somehow).  So when the voltage drops to zero on the
> "only on when running" pin the embedded device will shut itself down
> automatically (the device would be turned on manually via an "on"
> button).
>
> Is this theoretically possible using C?
>
> Greg
>
> _______________________________________________
> TriLUG mailing list
>     http://www.trilug.org/mailman/listinfo/trilug
> TriLUG Organizational FAQ:
>     http://www.trilug.org/faq/TriLUG-faq.html




More information about the TriLUG mailing list