[Message Prev][Message
Next][Thread Prev][Thread Next][Message
Index][Thread Index]
New schema: joystick.basic
- Subject: New schema: joystick.basic
- From: John B
- Date: Thu, 03 Apr 2003 19:13:00 +0000
Hi all,
I've been using my PC's joystick port for a while now to connect
digital/analogue sensors, such as LDRs, PIRs etc.
and thought it's about time I involved XPL :-)
So, I propose the following joystick.basic protocol for transmitting
the status of the joystick port to other XPL devices so that they may act
on the
data.
Full details below.
Regards,
John
Schema Definition
-----------------
Class = JOYSTICK
Type = BASIC
The joystick port found on most PCs today provides 4 digital and 4 analogue
input lines.
This schema defines a method of relaying the status of these inputs to
devices
on an XPL network.
XPL-TRIG Structure
------------------
JOYSTICK.BASIC
{
BUTTON1=0 1
BUTTON2=0 1
BUTTON3=0 1
BUTTON4=0 1
XPOS=n
YPOS=n
ZPOS=n
RPOS=n
}
n = a decimal integer between 0 and 65535.
XPL-CMND Structure
------------------
Not applicable
XPL-STAT Structure
------------------
HBEAT.*
{
(hbeat items)
(status items)
}
Schema Specific Notes
---------------------
This Schema provides a method of transmitting input readings
from the joystick port over an XPL network to be acted on by other
receivers.
The intention is that the XPL message contains only the raw
data derived from the state of the input pins on the joystick port,
and that it is the responsibility of a more intelligent controller
elsewhere
on the XPL network to interpret the raw data.
The XPL-TRIG message should be sent whenever any of the digital inputs
(buttons)
change state.
The heartbeat message should contain the status of all digital and analogue
inputs
in addition to the mandatory items.
The digital inputs are referred to as BUTTON1, BUTTON2, BUTTON3 and
BUTTON4, and
the analogue inputs as XPOS, YPOS, ZPOS and RPOS. This is in keeping with
the
naming conventions used in the Win32 API.
The XPL-TRIG message does not indicate which of the inputs has changed
state,
however this functionality may be added in a more advanced type of joystick
schema, and a receiver
which is interested in a particular digital input can easily keep track
of it's last known state to determine whether or not it's state has
changed.
Although this schema does not specify sending an XPL-TRIG message when the
state
of an analogue pin changes, the value of an analogue pin can be monitored
on a
regular
basis by examining the heartbeat messages.
Standard Notes
--------------
HBEAT.* = hbeat.basic or hbeat.app etc
(hbeat items) = standard .basic or .app heartbeat items
[<something>] = optional
xPL Main Index |
xPL Thread Index |
xPL Home |
Archives Home
|