From 00372ea266d1f0424b75b5164c86fb05907a2c8d Mon Sep 17 00:00:00 2001 From: "Kevin Veen-Birkenbach [aka. Frantz]" Date: Fri, 8 May 2020 13:33:31 +0200 Subject: [PATCH] Optimized comunication --- scripts/monitor.sh | 1 - scripts/read-serial.sh | 3 --- scripts/serial-communication.sh | 10 ++++++++++ 3 files changed, 10 insertions(+), 4 deletions(-) delete mode 100644 scripts/monitor.sh delete mode 100644 scripts/read-serial.sh create mode 100644 scripts/serial-communication.sh diff --git a/scripts/monitor.sh b/scripts/monitor.sh deleted file mode 100644 index 58c0975..0000000 --- a/scripts/monitor.sh +++ /dev/null @@ -1 +0,0 @@ -https://arduino.stackexchange.com/questions/19002/use-unix-terminal-instead-of-the-monitor-on-arduino-ide diff --git a/scripts/read-serial.sh b/scripts/read-serial.sh deleted file mode 100644 index cea577d..0000000 --- a/scripts/read-serial.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -stty -F /dev/ttyUSB0 cs8 9600 ignbrk -brkint -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke noflsh -ixon -crtscts -screen /dev/ttyUSB0 9600 diff --git a/scripts/serial-communication.sh b/scripts/serial-communication.sh new file mode 100644 index 0000000..71bc29d --- /dev/null +++ b/scripts/serial-communication.sh @@ -0,0 +1,10 @@ +#!/bin/bash +DEVICE="/dev/ttyUSB0" +BAUT_RATE="9600" +echo "Setting up output device \"$DEVICE\" with baut rate $BAUT_RATE." && +stty -F "$DEVICE" cs8 "$BAUT_RATE" ignbrk -brkint -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke noflsh -ixon -crtscts && +echo "Start interactive session with screen. You can close this session via \"screen -X -S arduino quit\"." && +gnome-terminal -- /bin/bash -c 'screen -S "arduino" "'$DEVICE'" "'$BAUT_RATE'";' && +echo "To terminate screen type enter..." && +read && +screen -X -S arduino quit && exit 1