what is a good program for handling input and executing programs?
My question may seem vague, but basically what I need is a program that will accept input from say a parallel or serial port and executing a command. Mostly I need this for my alarm system for my Lab. I'm going to hook up the device to close a switch (on a parallel or serial port) and cause my computer to execute a command to take a picture, or play an audio file of a gun being cocked.
Any suggestions would be greatly appreciated. thanks in advance -kev |
Quote:
1. You can read from the buffer and echo the result to another script or command thus: #/bin/bash while true do read LINE < /dev/tty0S echo $LINE done Or instead of the echo command you can insert more processing commands. 2. You can use dd to process the raw input. See info coreutils for everything dd can do. Remember that /dev/ttySO is a file. If you know how many bytes to expect you can even do this in a script. dd if=/dev/ttyS0 count=1 bs=8 Add the option of=filename to put the output into a file or add a pipe (|) to pipe the output of dd to other commands. There are probably some pages on the web for using dd. It used to be quite prevalent in the old Unix world for processing telemetry data received from a modem connection back in the pre www days, so you may have to dig and delve in the written world. |
so would this repeat itself, or if it goes off once then the program just exits?
Also, what command would I do to get the data off of a USB port? -kev |
All times are GMT -5. The time now is 06:52 AM. |