Mercurial > louis > kiibohd-controller
comparison Scan/STLcd/exampleAPI.bash @ 398:63b1d003fd50
Stop requiring editing of example scripts
The example scripts include hardcoded values that
do not work for everyone. Instead of requiring the
files to be edited (and dirtying the git tree),
allow them to take command-line arguments.
Also adds better guidance for Mac OSX virtual
serial ports.
author | Joshua Flanagan <joshuaflanagan@gmail.com> |
---|---|
date | Tue, 10 Nov 2015 10:32:06 -0600 |
parents | 3e5a95c196f8 |
children | 88814d3c0c8b |
comparison
equal
deleted
inserted
replaced
396:9ec758fc2e1f | 398:63b1d003fd50 |
---|---|
1 #!/bin/bash | 1 #!/bin/bash |
2 # STLcd | 2 # STLcd |
3 # Virtual Serial Port API Example | 3 # Virtual Serial Port API Example |
4 # Jacob Alexander 2015 | 4 # Jacob Alexander 2015 |
5 | 5 |
6 if [ $# -eq 0 ]; then | |
7 echo "You must specify your virtual serialport. (/dev/ttyACM0 on linux, /dev/cu.usbmodemXXXX on OSX)" | |
8 echo " ex: $0 /dev/ttyACM0" | |
9 exit 1 | |
10 fi | |
6 # XXX Set this to match your virtual serialport | 11 # XXX Set this to match your virtual serialport |
7 # TODO Show examples for Mac OSX and Cygwin/Windows | 12 # TODO Show example for Cygwin/Windows |
8 SERIALPORT=/dev/ttyACM0 | 13 # For Mac OSX it will be something like /dev/cu.usbmodem1413 (number may differ) |
14 SERIALPORT=$1 | |
9 | 15 |
10 # NOTE: Make sure you don't write too quickly to the serial port, it can get overwhelmed by a modern computer | 16 # NOTE: Make sure you don't write too quickly to the serial port, it can get overwhelmed by a modern computer |
11 # Generally this just means commands will get ignored | 17 # Generally this just means commands will get ignored |
12 # I'm using 100 ms sleeps here, but much smaller are probably sufficient | 18 # I'm using 100 ms sleeps here, but much smaller are probably sufficient |
13 | 19 |