]> git.donarmstrong.com Git - kiibohd-controller.git/commitdiff
Merge pull request #73 from joshuaflanagan/example_script_variables
authorJacob Alexander <haata@kiibohd.com>
Tue, 10 Nov 2015 19:24:03 +0000 (11:24 -0800)
committerJacob Alexander <haata@kiibohd.com>
Tue, 10 Nov 2015 19:24:03 +0000 (11:24 -0800)
Stop requiring editing of example scripts

Scan/ISSILed/exampleAPI.bash
Scan/STLcd/bitmap2Struct.py
Scan/STLcd/exampleAPI.bash

index 5d66c3717c742c5c8c899fbd0e8e449d46d36ebe..91eeebf4b9d428c9948ededb25e927aec68d3c34 100755 (executable)
@@ -3,9 +3,15 @@
 # Virtual Serial Port API Example
 # Jacob Alexander 2015
 
+if [ $# -eq 0 ]; then
+  echo "You must specify your virtual serialport. (/dev/ttyACM0 on linux, /dev/cu.usbmodemXXXX on OSX)"
+  echo "  ex: $0 /dev/ttyACM0"
+  exit 1
+fi
 # XXX Set this to match your virtual serialport
-# TODO Show examples for Mac OSX and Cygwin/Windows
-SERIALPORT=/dev/ttyACM0
+# TODO Show examples for Cygwin/Windows
+# For Mac OSX it will be something like /dev/cu.usbmodem1413 (number may differ)
+SERIALPORT=$1
 
 # NOTE: Make sure you don't write too quickly to the serial port, it can get overwhelmed by a modern computer
 #       Generally this just means commands will get ignored
index f0790a29aa5f5b1ceb46da830ed81999076c08d2..6f2cbf128bf8c971766983c41485e2c234059774 100755 (executable)
@@ -110,7 +110,10 @@ class STLcdGraphic:
                return display
 
 
-filename = "ic_logo_lcd.bmp"
+filename = sys.argv[1]
+if filename is None:
+       print( "You must specify a bitmap filename. Try './bitmap2Struct.py ic_logo_lcd.bmp'" )
+       sys.exit( 1 )
 max_height = 32
 max_width = 128
 x_offset = 0
index 8c2dda5871458b8ad0009a14fbc7bf63216da404..dfce9d18ade84a4184422bbc07b2b27416d271c8 100755 (executable)
@@ -3,9 +3,15 @@
 # Virtual Serial Port API Example
 # Jacob Alexander 2015
 
+if [ $# -eq 0 ]; then
+  echo "You must specify your virtual serialport. (/dev/ttyACM0 on linux, /dev/cu.usbmodemXXXX on OSX)"
+  echo "  ex: $0 /dev/ttyACM0"
+  exit 1
+fi
 # XXX Set this to match your virtual serialport
-# TODO Show examples for Mac OSX and Cygwin/Windows
-SERIALPORT=/dev/ttyACM0
+# TODO Show example for Cygwin/Windows
+# For Mac OSX it will be something like /dev/cu.usbmodem1413 (number may differ)
+SERIALPORT=$1
 
 # NOTE: Make sure you don't write too quickly to the serial port, it can get overwhelmed by a modern computer
 #       Generally this just means commands will get ignored