您现在的位置是:主页 > news > 做商城网站需要什么资质/网络营销前景和现状分析
做商城网站需要什么资质/网络营销前景和现状分析
admin2025/5/8 23:09:38【news】
简介做商城网站需要什么资质,网络营销前景和现状分析,网络营销工具及其特点,代刷网站建设以下是我正在尝试做的事情,我有一个带有温度信息的arduino将通过串行方式发送到Linux盒子。我正在成功读取串行数据并将其记录到一个带有cat的文件中,然后尾随文件。很好的作品。我想在某些控件上添加广告,以便能够拖拽文件,停止拖…
以下是我正在尝试做的事情,我有一个带有温度信息的arduino将通过串行方式发送到Linux盒子。我正在成功读取串行数据并将其记录到一个带有cat的文件中,然后尾随文件。很好的作品。我想在某些控件上添加广告,以便能够拖拽文件,停止拖拽但继续录制,或一起关闭该程序。所以这就是我认为我在这里成功完成的任务,但是我得到了来自linux的最奇怪的错误。我讨厌手动敲猫,我想要一个漂亮简单的小界面。我尝试了许多不同的方法来实现这些结果,并且我愿意接受新的方法。在linux中使用bash脚本通过轮询按键来启动和停止尾部
起初,当我开始我的程序中出现
./arduinodue.sh: 20: ./arduinodue.sh: [[: not found
./arduinodue.sh: 25: ./arduinodue.sh: [[: not found
以下错误,如果我按任意键此开始攻年代后或x足够的时间,我得到这个
Press S to start and stop tail
Press X to close and stop recording
最终向下滚动屏幕我的代码如下:
#!/bin/sh
#below opens serial connection
stty -F /dev/ttyACM0 cs8 19200 ignbrk -brkint -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke noflsh -ixon -crtscts
cat /dev/ttyACM0 > $HOME/Due.log & #starts cat recording serial data to Due.log as a background task
PID1=$! #records PID of cat
nottailing2() { #prints a message with instructions
echo "\n"
echo "Press S to start and stop tail\n"
echo "Press X to close and stop recording\n"
nottailing
}
nottailing() { #starts a while loop waiting for a keypress I attempted running without while loop and instead used function calls to redirect the run sequence with simular results
if [ -t 0 ]; then stty -echo -icanon time 0 min 0; fi #makes a keypress interrupt I believe but I've also attempted to run without that
while [ "x$keypress" = "x" ]; do
keypress=''
read keypress
if [[ "$keypress" == [X,x]* ]]; then #press x to kill the script cleanly
if [ -t 0 ]; then stty sane; fi
kill $PID1
exit 1
fi
if [[ "$keypress" == [S,s]* ]]; then #press s to start tail
if [ -t 0 ]; then stty sane; fi #close interrupt?
break
fi
done
if [ -t 0 ]; then stty sane; fi
tailing
}
tailing() { #same as function nottailing except it stops the tailing instead of starting it
if [ -t 0 ]; then stty -echo -icanon time 0 min 0; fi
while [ "x$keypress" = "x" ]; do
keypress=''
read keypress
if [[ "$keypress" == [X,x]* ]]; then
if [ -t 0 ]; then stty sane; fi
kill $PID1
exit 1
fi
if [[ "$keypress" == [S,s]* ]]; then
if [ -t 0 ]; then stty sane; fi
break
fi
done
if [ -t 0 ]; then stty sane; fi
nottailing2
}
nottailing2 #start the looping process
2014-10-03
Cfoote7