Pololu Maestro Servo Controller

C
http://www.pololu.com/docs/0J40/5.h.1

gcc setmaestro.c -o setmaestro ./setmaestro /dev/tty.usbmodem00072841 0 6000

Bash
http://www.pololu.com/product/1350

> system_profiler SPUSBDataType ...      Pololu Micro Maestro 6-Servo Controller:

Product ID: 0x0089 Vendor ID: 0x1ffb Version: 1.02 Serial Number: 00072848 Speed: Up to 12 Mb/sec Manufacturer: Pololu Corporation Location ID: 0x14300000 / 1 Current Available (mA): 500 Current Required (mA): 100 ...

http://www.pololu.com/docs/0J40/5.h.4 DEVICE=$1 CHANNEL=$2 TARGET=$3
 * 1) !/bin/bash
 * 2) Sends a Set Target command to a Pololu Maestro servo controller
 * 3) via its virtual serial port.
 * 4) Usage: maestro-set-target.sh DEVICE CHANNEL TARGET
 * 5) Linux example: bash maestro-set-target.sh /dev/ttyACM0 0 6000
 * 6) Mac OS X example: bash maestro-set-target.sh /dev/cu.usbmodem00234567 0 6000
 * 7) Windows example: bash maestro-set-target.sh '\\.\USBSER000' 0 6000
 * 8) Windows example: bash maestro-set-target.sh '\\.\COM6' 0 6000
 * 9) CHANNEL is the channel number
 * 10) TARGET is the target in units of quarter microseconds.
 * 11) The Maestro must be configured to be in USB Dual Port mode.

byte { printf "\\x$(printf "%x" $1)" }

{ byte 0x84 byte $CHANNEL byte $((TARGET & 0x7F)) byte $((TARGET >> 7 & 0x7F)) } > $DEVICE