<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://oiswiki.sysadninjas.net/w/index.php?action=history&amp;feed=atom&amp;title=Arduinos_in_Space_API</id>
		<title>Arduinos in Space API - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://oiswiki.sysadninjas.net/w/index.php?action=history&amp;feed=atom&amp;title=Arduinos_in_Space_API"/>
		<link rel="alternate" type="text/html" href="https://oiswiki.sysadninjas.net/w/index.php?title=Arduinos_in_Space_API&amp;action=history"/>
		<updated>2026-05-17T16:50:07Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>https://oiswiki.sysadninjas.net/w/index.php?title=Arduinos_in_Space_API&amp;diff=1059&amp;oldid=prev</id>
		<title>Stibbons at 12:29, 15 August 2018</title>
		<link rel="alternate" type="text/html" href="https://oiswiki.sysadninjas.net/w/index.php?title=Arduinos_in_Space_API&amp;diff=1059&amp;oldid=prev"/>
				<updated>2018-08-15T12:29:36Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 12:29, 15 August 2018&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l218&quot; &gt;Line 218:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 218:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This struct contains information necessary to create a request or command channel. Each Arduinos in Space release includes OISCommand constants for all known requests and commands at time of release, with variable names identical to the &amp;lt;tt&amp;gt;name&amp;lt;/tt&amp;gt; field. It shouldn&amp;#039;t be necessary to create your own.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This struct contains information necessary to create a request or command channel. Each Arduinos in Space release includes OISCommand constants for all known requests and commands at time of release, with variable names identical to the &amp;lt;tt&amp;gt;name&amp;lt;/tt&amp;gt; field. It shouldn&amp;#039;t be necessary to create your own.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:ArduinosInSpace]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key oiswiki:diff:version:1.11a:oldid:1058:newid:1059 --&gt;
&lt;/table&gt;</summary>
		<author><name>Stibbons</name></author>	</entry>

	<entry>
		<id>https://oiswiki.sysadninjas.net/w/index.php?title=Arduinos_in_Space_API&amp;diff=1058&amp;oldid=prev</id>
		<title>Stibbons at 12:27, 15 August 2018</title>
		<link rel="alternate" type="text/html" href="https://oiswiki.sysadninjas.net/w/index.php?title=Arduinos_in_Space_API&amp;diff=1058&amp;oldid=prev"/>
				<updated>2018-08-15T12:27:55Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 12:27, 15 August 2018&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l207&quot; &gt;Line 207:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 207:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Send a text message to the game. This will be treated as a debug message, and appended to the game log file. Arduinos in Space uses this internally to send a banner message (&amp;quot;Arduinos in Space version x.x.x device successfully connected!&amp;quot;) on initial connectionn.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Send a text message to the game. This will be treated as a debug message, and appended to the game log file. Arduinos in Space uses this internally to send a banner message (&amp;quot;Arduinos in Space version x.x.x device successfully connected!&amp;quot;) on initial connectionn.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;== OISCommand ==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;A struct representing a possible Objects in Space channel.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;=== Attributes ===&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* &amp;lt;pre&amp;gt;int channel&amp;lt;/pre&amp;gt; The channel ID. Only used for command channels.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* &amp;lt;pre&amp;gt;char const * name&amp;lt;/pre&amp;gt; The full text name of the channel.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;This struct contains information necessary to create a request or command channel. Each Arduinos in Space release includes OISCommand constants for all known requests and commands at time of release, with variable names identical to the &amp;lt;tt&amp;gt;name&amp;lt;/tt&amp;gt; field. It shouldn&amp;#039;t be necessary to create your own.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key oiswiki:diff:version:1.11a:oldid:1057:newid:1058 --&gt;
&lt;/table&gt;</summary>
		<author><name>Stibbons</name></author>	</entry>

	<entry>
		<id>https://oiswiki.sysadninjas.net/w/index.php?title=Arduinos_in_Space_API&amp;diff=1057&amp;oldid=prev</id>
		<title>Stibbons: Created page, documentation for ObjectsInSpace class.</title>
		<link rel="alternate" type="text/html" href="https://oiswiki.sysadninjas.net/w/index.php?title=Arduinos_in_Space_API&amp;diff=1057&amp;oldid=prev"/>
				<updated>2018-08-15T12:21:18Z</updated>
		
		<summary type="html">&lt;p&gt;Created page, documentation for ObjectsInSpace class.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== ObjectsInSpace class ==&lt;br /&gt;
&lt;br /&gt;
This is the main interface for Arduinos In Space. A single ObjectsInSpace object manages all aspects of a serial connection. It provides an interface to send commands to the game, and can poll input pins to trigger those commannds. It also allows to request data from the game, and will pass received data to a specified output pin, or a callback function for more complex requests.&lt;br /&gt;
&lt;br /&gt;
=== Constructors ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ObjectsInSpace( Stream &amp;amp; serial,&lt;br /&gt;
                     int numRequests,&lt;br /&gt;
                     int numCommandPins&lt;br /&gt;
              )&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates an ObjectsInSpace object to manage a serial connection. Note that this constructor will &amp;#039;&amp;#039;not&amp;#039;&amp;#039; attempt to start the serial interface, it must be started separately with eg &amp;lt;tt&amp;gt;Serial.begin()&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Parameters&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;lt;tt&amp;gt;serial&amp;lt;/tt&amp;gt; The serial instance this object will use to communicate with the game. Usually &amp;lt;tt&amp;gt;Serial&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* &amp;lt;tt&amp;gt;numRequests&amp;lt;/tt&amp;gt; The number of request channels to allocate. This is the maximum number of requests for data this object will support. It does &amp;#039;&amp;#039;not&amp;#039;&amp;#039; include command channels.&lt;br /&gt;
* &amp;lt;tt&amp;gt;numCommandPins&amp;lt;/tt&amp;gt; The number of &amp;#039;&amp;#039;managed&amp;#039;&amp;#039; input pins to allocate. This is the maximum number of commands channels with managed input pins (created via &amp;lt;tt&amp;gt;registerLatching()&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;registerTrigger()&amp;lt;/tt&amp;gt;) the object will support. Commands that will be send directly through &amp;lt;tt&amp;gt;sendCommand()&amp;lt;/tt&amp;gt; do not need to be included here.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ObjectsInSpace( Stream &amp;amp; serial,&lt;br /&gt;
                     int numRequests&lt;br /&gt;
              )&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that this constructor is &amp;#039;&amp;#039;&amp;#039;deprecated&amp;#039;&amp;#039;&amp;#039;, and will be removed in a future release. Identical to the main constructor, but the created object will not be able to support any managed input pins.&lt;br /&gt;
&lt;br /&gt;
=== Member functions ===&lt;br /&gt;
&lt;br /&gt;
==== Handshaking phase ====&lt;br /&gt;
===== begin() =====&lt;br /&gt;
&lt;br /&gt;
Initialise the connection, and perform handshaking with the game.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;void ObjectsInSpace::begin()&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;begin()&amp;lt;/tt&amp;gt; function will periodically send a handshake request packet, and wait for the game to send a successful response. This is a blocking function - it won&amp;#039;t return until handshaking is successful and the game has moved to the Synchronisation phase of the connection.&lt;br /&gt;
&lt;br /&gt;
==== Synchronisation phase ====&lt;br /&gt;
===== activate() =====&lt;br /&gt;
&lt;br /&gt;
Start active phase&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;void ObjectsInSpace::activate()&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;activate()&amp;lt;/tt&amp;gt; function tells the game that we have completed synchronising commands and requests with the game, and are ready to move in to the active phase of the connection. The game will start sending live data and processing game commands we send.&lt;br /&gt;
&lt;br /&gt;
==== Request channels ====&lt;br /&gt;
&lt;br /&gt;
These functions, executed during the synchronisation phase, set up channels requesting data from the game.&lt;br /&gt;
&lt;br /&gt;
===== registerBool() =====&lt;br /&gt;
&lt;br /&gt;
Register a request for boolean data (true/false, 1/0, on/off).&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;int ObjectsInSpace::registerBool( OISCommand command,&lt;br /&gt;
                                         int pin,&lt;br /&gt;
                                        bool invert=false&lt;br /&gt;
                                )&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function will create a channel to receive the requested boolean data from the game. When data on this channel is received, Arduinos in Space will change the status of the given output pin to match the data received. Note that this function also sets the pin mode appropriately, there is no need for a separate &amp;lt;tt&amp;gt;pinMode()&amp;lt;/tt&amp;gt; call. The maximum number of request channels that can be created is specified by the numRequests argument to the ObjectsInSpace constructor. Attempts to request more than this limit will silently fail.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Parameters&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;lt;tt&amp;gt;command&amp;lt;/tt&amp;gt; The data command to request.&lt;br /&gt;
* &amp;lt;tt&amp;gt;pin&amp;lt;/tt&amp;gt; A pin number to control.&lt;br /&gt;
* &amp;lt;tt&amp;gt;invert&amp;lt;/tt&amp;gt; By default, the output pin will be set high if a boolean true is received on this channel, and low if a boolean false is received. Set the optional invert parameter to true to invert this logic.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Returns&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
A unique index of this request in the internal request list.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;int ObjectsInSpace::registerBool(   OISCommand command,&lt;br /&gt;
                                  boolCallback callback&lt;br /&gt;
                                )&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function will create a channel to receive the requested boolean data from the game. When data on this channel is received, Arduinos In Space will convert it to a boolean data type (true/false), and then pass it as an argument to the given callback function. The maximum number of request channels that can be created is specified by the numRequests argument to the ObjectsInSpace constructor. Attempts to request more than this limit will silently fail.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Parameters&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;lt;tt&amp;gt;command&amp;lt;/tt&amp;gt; The data command to request.&lt;br /&gt;
* &amp;lt;tt&amp;gt;callback&amp;lt;/tt&amp;gt; A callback function to handle the received data.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Returns&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
A unique index of this request in the internal request list.&lt;br /&gt;
&lt;br /&gt;
===== registerInt() =====&lt;br /&gt;
&lt;br /&gt;
Register a request for numeric data.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;int ObjectsInSpace::registerInt(  OISCommand command,&lt;br /&gt;
                                 intCallback callback&lt;br /&gt;
                               )&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function will create a channel to receive the requested integer data from the game. When data on this channel is received, Arduinos In Space will pass the data in integer format as an argument to the supplied callback function. The maximum number of request channels that can be created is specified by the numRequests argument to the ObjectsInSpace constructor. Attempts to request more than this limit will silently fail.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Parameters&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;lt;tt&amp;gt;command&amp;lt;/tt&amp;gt; The data command to request.&lt;br /&gt;
* &amp;lt;tt&amp;gt;callback&amp;lt;/tt&amp;gt; A callback function to handle the received data.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Return&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
A unique index of this request in the internal request list.&lt;br /&gt;
&lt;br /&gt;
===== registerFloat() =====&lt;br /&gt;
&lt;br /&gt;
Register a request for floating point data.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;int ObjectsInSpace::registerFloat(    OISCommand command,&lt;br /&gt;
                                   floatCallback callback&lt;br /&gt;
                                 )&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function will create a channel to receive the requested floating point data from the game. When data on this channel is received, Arduinos In Space will convert it to a floating point type (float), before passing it as an argument to the supplied callback function. The maximum number of request channels that can be created is specified by the numRequests argument to the ObjectsInSpace constructor. Attempts to request more than this limit will silently fail.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Parameters&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;lt;tt&amp;gt;commannd&amp;lt;/tt&amp;gt; The data command to request.&lt;br /&gt;
* &amp;lt;tt&amp;gt;callback&amp;lt;/tt&amp;gt; A callback function to handle the received data.&lt;br /&gt;
&lt;br /&gt;
==== Command channels ====&lt;br /&gt;
&lt;br /&gt;
These functions, executed during the synchronisation phase, request commands that we want to execute during the active phase.&lt;br /&gt;
&lt;br /&gt;
===== registerCommand() =====&lt;br /&gt;
&lt;br /&gt;
Register a client command.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;int ObjectsInSpace::registerCommand( OISCommand command )&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before the game will accept a given command, it must be registered. This function will register the command.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Parameters&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;lt;tt&amp;gt;command&amp;lt;/tt&amp;gt; The command to register.&lt;br /&gt;
&lt;br /&gt;
===== registerLatching() =====&lt;br /&gt;
&lt;br /&gt;
Register two commands bound to an input pin in latching mode.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;int ObjectsInSpace::registerLatching (    uint8_t pin,&lt;br /&gt;
                                       OISCommand firstCommand,&lt;br /&gt;
                                       OISCommand secondCommand,&lt;br /&gt;
                                          uint8_t mode=INPUT&lt;br /&gt;
                                     )&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Arduinos In Space will poll the pin specified by &amp;lt;tt&amp;gt;pin&amp;lt;/tt&amp;gt;. The first time it switches from inactive to active the first command will be sent. The second time it switches from inactive to active the second command will be sent, and so on. The maximum number of managed command pins are specified by the numCommandPins argument when constructing an ObjectsInSpace object. Attempts to register more than this limit will silently fail.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Parameters&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;lt;tt&amp;gt;pin&amp;lt;/tt&amp;gt; The pin to monitor. Arduinos in Space will set the mode, do &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; call &amp;lt;tt&amp;gt;pinMode()&amp;lt;/tt&amp;gt; on this pin.&lt;br /&gt;
* &amp;lt;tt&amp;gt;firstCommand&amp;lt;/tt&amp;gt; The command to send first active change.&lt;br /&gt;
* &amp;lt;tt&amp;gt;secondCommand&amp;lt;/tt&amp;gt; The command to send second active change.&lt;br /&gt;
* &amp;lt;tt&amp;gt;active&amp;lt;/tt&amp;gt; This sets the pin mode, as well as what readings will be considered active. When set to &amp;lt;tt&amp;gt;INPUT&amp;lt;/tt&amp;gt;, the pin is active when HIGH. When set to &amp;lt;tt&amp;gt;INPUT_PULLUP&amp;lt;/tt&amp;gt;, the pin is active when LOW.&lt;br /&gt;
&lt;br /&gt;
===== registerTrigger() =====&lt;br /&gt;
&lt;br /&gt;
Registers one or two commands bound to a single input pin in trigger mode.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;int ObjectsInSpace::registerTrigger (    uint8_t pin,&lt;br /&gt;
                                      OISCommand activeCommand,&lt;br /&gt;
                                         uint8_t mode = INPUT&lt;br /&gt;
                                    )&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Arduinos In Space will poll the pin specified by &amp;lt;tt&amp;gt;pin&amp;lt;/tt&amp;gt;, and whenever it changes from inactive to active will send the given client command. The maximum number of managed command pins are specified by the numCommandPins argument when constructing an ObjectsInSpace object. Attempts to register more than this limit will silently fail.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Parameters&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;lt;tt&amp;gt;pin&amp;lt;/tt&amp;gt; The pin to monitor. Arduinos in Space will set the mode, do &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; call &amp;lt;tt&amp;gt;pinMode()&amp;lt;/tt&amp;gt; on this pin.&lt;br /&gt;
* &amp;lt;tt&amp;gt;activeCommand&amp;lt;/tt&amp;gt; The command to send when the pin goes active.&lt;br /&gt;
* &amp;lt;tt&amp;gt;mode&amp;lt;/tt&amp;gt; This sets the pin mode, as well as what readings will be considered active. When set to &amp;lt;tt&amp;gt;INPUT&amp;lt;/tt&amp;gt;, the pin is active when HIGH. When set to &amp;lt;tt&amp;gt;INPUT_PULLUP&amp;lt;/tt&amp;gt;, the pin is active when LOW.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;int ObjectsInSpace::registerTrigger (    uint8_t pin,&lt;br /&gt;
                                      OISCommand activeCommand,&lt;br /&gt;
                                      OISCommand inactiveCommand,&lt;br /&gt;
                                         uint8_t mode = INPUT&lt;br /&gt;
                                    )&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Arduinos In Space will poll the pin specified by &amp;lt;tt&amp;gt;pin&amp;lt;/tt&amp;gt;, sending activeCommand when the pin changes from inactive to active, and inactiveCommand when the pin changes from active to inactive. The maximum number of managed command pins are specified by the numCommandPins argument when constructing an ObjectsInSpace object. Attempts to register more than this limit will silently fail.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Parameters&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;lt;tt&amp;gt;pin&amp;lt;/tt&amp;gt; The pin to monitor. Arduinos in Space will set the mode, do &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; call &amp;lt;tt&amp;gt;pinMode()&amp;lt;/tt&amp;gt; on this pin.&lt;br /&gt;
* &amp;lt;tt&amp;gt;activeCommand&amp;lt;/tt&amp;gt; The command to send when the pin goes active.&lt;br /&gt;
* &amp;lt;tt&amp;gt;inactiveCommand&amp;lt;/tt&amp;gt; The command to send when the pin goes inactive.&lt;br /&gt;
* &amp;lt;tt&amp;gt;mode&amp;lt;/tt&amp;gt; This sets the pin mode, as well as what readings will be considered active. When set to &amp;lt;tt&amp;gt;INPUT&amp;lt;/tt&amp;gt;, the pin is active when HIGH. When set to &amp;lt;tt&amp;gt;INPUT_PULLUP&amp;lt;/tt&amp;gt;, the pin is active when LOW.&lt;br /&gt;
&lt;br /&gt;
==== Active phase ====&lt;br /&gt;
&lt;br /&gt;
===== update() =====&lt;br /&gt;
&lt;br /&gt;
The main ObjectsInSpace loop.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;void ObjectsInSpace::update()&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Polls for new serial data, checks managed pin state, keeps the ObjectsInSpace object state consistent. This method should be run fairly frequently, ensure a call to it is in your &amp;lt;tt&amp;gt;loop()&amp;lt;/tt&amp;gt; function at least once.&lt;br /&gt;
&lt;br /&gt;
===== sendCommand() =====&lt;br /&gt;
&lt;br /&gt;
Send a command to the game.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;void ObjectsInSpace::sendCommand( OISCommand command )&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The given command is sent to the game. Commands sent during the active phase should have been registered with &amp;lt;tt&amp;gt;registerCommannd()&amp;lt;/tt&amp;gt; during synchronisation. Arduinos in Space does not track registered commands, though, so will send any valid command passed to &amp;lt;tt&amp;gt;sendCommand()&amp;lt;/tt&amp;gt;. The game will (should?) ignore commands that were not requested.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Parameters&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;lt;tt&amp;gt;commannd&amp;lt;/tt&amp;gt; The command to send.&lt;br /&gt;
&lt;br /&gt;
===== sendDebug() =====&lt;br /&gt;
&lt;br /&gt;
Send a log message to the game.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;void ObjectsInSpace::sendDebug( char * message )&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Send a text message to the game. This will be treated as a debug message, and appended to the game log file. Arduinos in Space uses this internally to send a banner message (&amp;quot;Arduinos in Space version x.x.x device successfully connected!&amp;quot;) on initial connectionn.&lt;/div&gt;</summary>
		<author><name>Stibbons</name></author>	</entry>

	</feed>