View Source

Notes about USB and Bluetooth hardware accessories.

While the app must not require any external hardware, it is an advantage to have external input devices which emulate on-screen button presses particularly in cases when the operator needs to be carefully observing something momentary such as pilot passing a timing gate and can't be looking at the touch-screen of the device at the same time.

By far the most common input will be some kind of make or break switching action which can be converted into a digital USB input with a simple keyboard emulator. Same thing can be used to manage input from automatic switching devices eg timing gate sensors or kick-stick sensors.

For this, there must be an external input protocol so the app knows what to do with keystroke inputs from devices.

Typical keystrokes will be 'unusual' keystroke combinations which are unlkely to have come from any other source (eg an inbuilt keyboard).

h5. Protocol option a
* Task requires a stopwatch-like ability (start, stop, lap, reset)
* A hardware device such as a button box sends unusual keystrokes to the app, eg on this device the green button sends ctrl-A.
* Task setup file includes an instruction that if keystroke ctrl-A is received, this means press 'start' button on screen.

*Advantage*: Means a button press can mean different things in different tasks.

*Disadvantage*: Operators may have different button boxes, green button on this one sends ctrl-A, but that one sends ctrl-Z

h5. Protocol option b
* Task requires a stopwatch-like ability (start, stop, lap, reset)
* A library of keypress meanings is established where it is known that ctrl-A always means timer start.

*Advantage*: No setup configuration needed (ie a timer component in the app is hard coded to know that if ctrl-A is received this always means stopwatch-start). Transparent support of different devices.

*Disadvantage*: Means a physical device eg button box will either have only one purpose, (eg stopwatch) or needs some more complex switching ability to convert between 'modes', ie in mode a (stopwatch) a green button press sends ctrl-A but switch it to mode b (counter) and a green button press sends ctrl-X which in the common protocol means increment current count by one.

h5. Best option?
* Despite the disadvantage of always requiring to be configured, Option a is probably the most flexible, is simpler to control settings in software than hardware.
* A list of 'recommended' button presses could be published so it would be 'normal' for a green button to always send ctrl-A and that means start timer (of a stopwatch), increment by 1 (of a counter) Etc.

h5. Cheap and simple USB keyboard emulators (eg for button boxes)
* [teensy|]
* [U-hid|]
* [I-Pac|]
* [Pokeys56U|]
* [GPwiz40|]
* [Reverse engineer an old keyboard|]

h5. Other hardware
* [Fentek ready-made usb button boxes|]
* [Android IOIO|] designed to also work in Android host mode which opens many possibilities eg this simple [laser tripwire|]
* [AVR Stick|] can use something like [hidkeys|]