Software Source Code

Version 1 (J. Simmons, 08/23/2013 08:40 pm) → Version 2/7 (J. Simmons, 12/11/2016 09:47 am)

h1. Project Software Source Code

{{>toc}}

h2. Introduction Current Version

The Holoseat project has three software elements. The first software element current version of the *Holoseat* is the firmware running based on the Holoseat controller. "How to build your own tachometer":http://www.instructables.com/id/Arduino-Based-Optical-Tachometer/ from "Instructables":http://www.instructables.com/. The second software element is the desktop configuration app. And the third software element is the test rig software (composed of more firmware and test execution software). This page covers each of these elements and the serial protocol between the Holoseat controller and the desktop configuration app. It runs on an "Arduino Uno":http://arduino.cc/en/Main/arduinoBoardUno

h2. Controller Firmware

tbd

h2. Desktop App

tbd

h2. Test Rig Software

tbd

h2. HoloSeat Serial Protocol

The HoloSeat firmware has a serial protocol, the Holoseat Serial Protocol (HSP),
It uses an interrupt to enable detect the desktop control application to modify all key parameters reed switch events and to determine the current configuration of the Holoseat.

h3. Protocol Commands

The HSP supports three commands. Each command is made up of
then increments a single upper case character indicating the statement type. counter. One command, The main loop then determines the (S)et statement, also takes an input string.

* @?@ - Ready(?) command; used to determine
RPM and if the HoloSeat it is ready to receive commands over above a given threshold, the HSP (will reply with the (R)eady message followed by one standard state message if the HoloSeat Arduino triggers a pin which is ready)
* @S <config string>@ - (S)et command; used
wired to send updated configuration a transistor to HoloSeat (HoloSeat will reply with @OK@ close a circuit on success). The config string has the following format:
@<WFC>,<WBC>,<E>,<TC>,<L>,<LI>@ - example: @S w,s,0,60,0,20@
** @<WFC>@ - Walk forward character (example: w)
** @<WBC>@ - Walk backward character (example: s)
** @<E>@ - Enabled? Must be
a @0@ (disabled) or a @1@ (enabled) (example: 1)
** @<TC>@ - Trigger cadence (example: 65)
** @<L>@ - Logging enabled? Must be a @0@ (disabled) or a @1@ (enabled) (example: 1)
** @<LI>@ - Logging interval in deci-seconds (example: 10)
* @Q@ - (Q)uery command; used to request
USB keyboard which presses the HoloSeat send one standard state message (see *Protocol Messages* below)

h3. Protocol Messages

The HSP has two messages.
*w* key. One is a single character message similar to When the commands and one is RPM drops below the HSP standard state message which threshold, the pin is sent after initialization, in reply to a (Q)uery command, untriggered and as the serial logging message. *w* key is no longer pressed.

* @R@ - (R)eady; sent by h2. Next Version

The next version of
the HoloSeat to indicate it is ready *Holoseat* will run on an "Arduino Leonardo":http://arduino.cc/en/Main/arduinoBoardLeonardo

The Leonardo can directly emulate a keyboard, eliminating the need
for serial communication; sent in reply to the Ready(?) command USB keyboard and the transistor. Instead, when serial port is attached in debug mode (to be added)
* @<VER>,<WFC>(<DWFC>),<WBC>(<DWBC>),<E>(<DE>),<C>/<TC>(<DTC>),<L>(<DL>)/<LI>(<DLI>)@ - standard state message, see below for key; example: @1.2.3,w(w),s(s),1(1),70/65(75),1(0)/10(10)@
** @<VER>@ - Firmware version string (example: 1.2.3)
** @<WFC>@ - Walk forward character (example: w)
** @<DWFC>@ - Default walk forward character (example: w)
** @<WBC>@ - Walk backward character (example: s)
** @<DWBC>@ - Default walk backward character (example: s)
** @<E>@ - Enabled? Must be a @0@ (disabled) or a @1@ (enabled) (example: 1)
** @<DE>@ - Default enabled state, same format as @<E>@ (example: 1)
** @<C>@ - Current cadence rounded to whole number; positive value means direction is forward, negative value means direction is backward (example: 70)
** @<TC>@ - Trigger cadence (example: 65)
** @<DTC>@ - Default trigger cadence (example: 75)
** @<L>@ - Logging enabled? Must be a @0@ (disabled) or a @1@ (enabled) (example: 1)
** @<DL>@ - Default logging enabled, same format as @<L>@ (example: 0)
** @<LI>@ - Logging interval in deci-seconds (example: 10)
** @<DLI>@ - Default logging interval in deci-seconds (example: 10)

h3. Protocol Usage

Always start a serial session by sending a Ready(?) command. If a (R)eady message is not received, wait and try again until a timeout is reached or a (R)eady message is received. Be sure to check
the version string sent in RPM passes the initial standard state message to ensure your app is compatible with given threshold the version of Arduino will directly send the HoloSeat firmware.

After you have initialized your connection, you can then use the (Set) and (Q)uery commands as necessary
*w* key signal to control and observe the HoloSeat's state. PC.