I'm trying to use bash to read from ttyS0 and you need to install the following, but I'm trying to figure it out
databits = 7
stopbits = 2
parity = 0
flow control = 0
heres my code:
#!/bin/bash
stty -F /dev/ttyS0 raw speed 1200
while [ 1 ];
do
echo 'LOADING...'
READ=`dd if=/dev/ttyS0 count=1`
echo $READ
echo '[PRESS Ctrl + C TO EXIT]'
done
The script works, but I need to set the parameters. Any suggestions? And thanks:)
source
share