Search This Blog

2018-10-31

shell nano connect

#!/bin/sh
#
# usa: usb serial arduino
#
# connects to arduino as explained at:
#
https://playground.arduino.cc/Interfacing/LinuxTTY
#
usbSerialArduino () {
  #
  # configure serial port
  #
  stty -F "$1" cs8 9600 ignbrk \
    -brkint -icrnl -imaxbel -opost -onlcr \
    -isig -icanon -iexten -echo -echoe -echok \
    -echoctl -echoke noflsh -ixon -crtscts ;
  #
  # conect to serial port
  #
  busybox microcom -s 9600 "$1" ;
  #
} ;
#
usbSerialArduino /dev/ttyUSB${1:-0} ;
#