1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html xml:lang="en-US" lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
3  <head>
4    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5    <meta http-equiv="Content-Style-Type" content="text/css" />
6    <link rel="stylesheet" href="../../../../css/manpage.css" type="text/css" />
7    <style type="text/css"><!--
8      span.static_style
9      {
10        font-size			: 8pt;
11        color				: white;
12        font-weight			: bold;
13        background			: #44f;
14        border-left			: solid 1px #aaf;
15        border-top			: solid 1px #aaf;
16        border-right		: solid 1px #00c;
17        border-bottom		: solid 1px #00c;
18        padding-left		: 2px;
19        padding-right		: 2px;
20      }
21      span.virtual_style
22      {
23        font-size			 : 8pt;
24        color				 : white;
25        font-weight			: bold;
26        background			: #0a0;
27        border-left			: solid 1px #0f0;
28        border-top			: solid 1px #0f0;
29        border-right		: solid 1px #060;
30        border-bottom		: solid 1px #060;
31        padding-left		: 2px;
32        padding-right		: 2px;
33      }
34      span.protected_style
35      {
36        font-size			 : 8pt;
37        color				 : white;
38        font-weight			: bold;
39        background			: #444;
40        border-left			: solid 1px #ccc;
41        border-top			: solid 1px #ccc;
42        border-right		: solid 1px #222;
43        border-bottom		: solid 1px #222;
44        padding-left		: 2px;
45        padding-right		: 2px;
46      }
47        --></style>
48<title>nn::hid::CTR::AccelerometerReader</title>
49  </head>
50  <body>
51<h1><CODE><a href="../../../../nn/Overview.html">nn</a>::<a href="../../../../nn/hid/Overview.html">hid</a>::<a href="../../../../nn/hid/CTR/Overview.html">CTR</a>::AccelerometerReader</CODE> Class</h1>
52<h2>Syntax</h2>
53    <div class="section">
54<pre class="definition">class AccelerometerReader : private ADLFireWall::NonCopyable<AccelerometerReader></pre>
55    </div>
56<h2>Description</h2>
57    <div class="section">
58<p>Class for loading sampling data from the accelerometer.</p><h3>Sampling Rate</h3><p>
59The accelerometer is sampled an average of every 10 milliseconds. Use the <a href="../../../../nn/hid/CTR/Accelerometer/Overview.html"><CODE>nn::hid::CTR::Accelerometer</CODE></a> class to know when sampling occurs, allowing you to accurately monitor sampling timing.<BR /><BR />No sampling is done right after generating a class instance or right after recovering from sleep, so calls to the <a href="../../../../nn/hid/CTR/AccelerometerReader/Read.html"><CODE>nn::hid::CTR::AccelerometerReader::Read</CODE></a> or <a href="../../../../nn/hid/CTR/AccelerometerReader/ReadLatest.html"><CODE>nn::hid::CTR::AccelerometerReader::ReadLatest</CODE></a> functions might not have any effect. Waiting until results have been sampled at least once avoids this situation, so Nintendo recommends calling the <CODE><a href="../../../../nn/hid/CTR/HidBase/WaitSampling.html">nn::hid::CTR::HidBase::WaitSampling</a></CODE> function of the <CODE><a href="../../../../nn/hid/CTR/Accelerometer/Overview.html">nn::hid::CTR::Accelerometer</a></CODE> class right after generating a class instance or when recovering from sleep . This wait time is the same as the sampling frequency, up to a maximum of approximately 10 milliseconds.
60</p><h3>Conditions to Start Sampling</h3><p>
61Accelerometer sampling halts in two cases: when the system is in Sleep Mode, and when there are no instances of the <CODE>AccelerometerReader</CODE> class. You must destroy all instances to explicitly stop sampling.
62		</p><h3>Output Value Processing Features</h3><p>
63This class includes the following features to process output values.<table><tr><th>Acceleration Variation Tolerance</th><td>You can apply a correction to control any major variation in acceleration during continuous sampling.</td></tr><tr><th>Offset Correction</th><td>Outputs after subtracting the specified value from sampling results.</td></tr><tr><th>Axial Rotation</th><td>Outputs sampling results multiplied by an optional rotation matrix. Allows for the output of values as if the accelerometer were on an incline.</td></tr></table><BR />All processing features are disabled by default. Configure and enable them as needed. For details, see the various function references.
64</p><h3>Axis Orientation</h3><p>
65The default accelerometer sensors are as follows.<table><tr><th>X+</th><td>The direction indicated by Left on the +Control Pad</td></tr><tr><th>Y+</th><td>The direction normal to and outward from the Touch Screen</td></tr><tr><th>Z+</th><td>The direction indicated by Up on the +Control Pad</td></tr></table></p><h3>Recalibration from the HOME Menu</h3><p>
66A future update to the HOME menu will add a feature enabling users to recalibrate the accelerometer whenever they like.<br /><br />As a result, correction in accordance with the user's environment may start while the user transitions from the application to the HOME Menu by using the HOME Button.<br />After this operation, the values obtained from the <CODE><a href="../../../../nn/hid/CTR/AccelerometerReader/Read.html">nn::hid::CTR::AccelerometerReader::Read</a></CODE> and <CODE><a href="../../../../nn/hid/CTR/AccelerometerReader/ReadLatest.html">nn::hid::CTR::AccelerometerReader::ReadLatest</a></CODE> functions are the corrected values. In most cases, the corrected values will accurately reflect the user's environment.<br /><br />The applications, however, need not take any special measures to deal with this.
67        </p></div>
68    <a name="function" id="function">
69<h2>Member Functions</h2>
70      <div class="section">
71        <table class="members">
72          <tr>
73<th class="category" colspan="3">Constructors/Destructors</th>
74          </tr>
75          <tr>
76            <td width="100">  </td>
77            <th>
78<a href="../../../../nn/hid/CTR/AccelerometerReader/AccelerometerReader.html">AccelerometerReader</a>
79            </th>
80<td>Constructor.</td>
81          </tr>
82          <tr>
83            <td width="100">  </td>
84            <th>
85<a href="../../../../nn/hid/CTR/AccelerometerReader/~AccelerometerReader.html"><CODE>~AccelerometerReader</CODE></a>
86            </th>
87<td>Destructor.</td>
88          </tr>
89          <tr>
90<th class="category" colspan="3">Reading Sampling Data</th>
91          </tr>
92          <tr>
93            <td width="100">  </td>
94            <th>
95<a href="../../../../nn/hid/CTR/AccelerometerReader/Read.html"><CODE>Read</CODE></a>
96            </th>
97<td>Loads sampling data from the accelerometer starting with the newest samples. Does not load any data that has been previously loaded.</td>
98          </tr>
99          <tr>
100            <td width="100">  </td>
101            <th>
102<a href="../../../../nn/hid/CTR/AccelerometerReader/ReadLatest.html"><CODE>ReadLatest</CODE></a>
103            </th>
104<td>Loads the newest sampling data from the accelerometer. Unlike the <CODE><a href="../../../../nn/hid/CTR/AccelerometerReader/Read.html">nn::hid::CTR::AccelerometerReader::Read</a></CODE> function, this function can load the same sampling data more than once.</td>
105          </tr>
106          <tr>
107<th class="category" colspan="3">Control Functions for Acceleration Variation Tolerance</th>
108          </tr>
109          <tr>
110            <td width="100">  </td>
111            <th>
112<a href="../../../../nn/hid/CTR/AccelerometerReader/GetSensitivity.html"><CODE>GetSensitivity</CODE></a>
113            </th>
114<td>Gets the settings for sensitivity and play tolerance for the change in acceleration between samples.</td>
115          </tr>
116          <tr>
117            <td width="100">  </td>
118            <th>
119<a href="../../../../nn/hid/CTR/AccelerometerReader/SetSensitivity.html"><CODE>SetSensitivity</CODE></a>
120            </th>
121<td>Sets the sensitivity and play tolerance for the change in acceleration between samples.</td>
122          </tr>
123          <tr>
124<th class="category" colspan="3">Axial Rotation</th>
125          </tr>
126          <tr>
127            <td width="100">  </td>
128            <th>
129<a href="../../../../nn/hid/CTR/AccelerometerReader/EnableAxisRotation.html"><CODE>EnableAxisRotation</CODE></a>
130            </th>
131<td>Enables axial rotation of the accelerometer.</td>
132          </tr>
133          <tr>
134            <td width="100">  </td>
135            <th>
136<a href="../../../../nn/hid/CTR/AccelerometerReader/DisableAxisRotation.html"><CODE>DisableAxisRotation</CODE></a>
137            </th>
138<td>Disables axial rotation of the accelerometer.</td>
139          </tr>
140          <tr>
141            <td width="100">  </td>
142            <th>
143<a href="../../../../nn/hid/CTR/AccelerometerReader/IsEnableAxisRotation.html"><CODE>IsEnableAxisRotation</CODE></a>
144            </th>
145<td>Checks whether axial rotation is enabled or disabled for the accelerometer.</td>
146          </tr>
147          <tr>
148            <td width="100">  </td>
149            <th>
150<a href="../../../../nn/hid/CTR/AccelerometerReader/SetAxisRotationMatrix.html"><CODE>SetAxisRotationMatrix</CODE></a>
151            </th>
152<td>Specifies the rotation matrix used for axial rotation of the accelerometer's sampling data.</td>
153          </tr>
154          <tr>
155            <td width="100">  </td>
156            <th>
157<a href="../../../../nn/hid/CTR/AccelerometerReader/GetAxisRotationMatrix.html"><CODE>GetAxisRotationMatrix</CODE></a>
158            </th>
159<td>Gets the rotation matrix currently specified to use for axial rotation of the accelerometer's sampling data.</td>
160          </tr>
161          <tr>
162            <td width="100">  </td>
163            <th>
164<a href="../../../../nn/hid/CTR/AccelerometerReader/ResetAxisRotationMatrix.html"><CODE>ResetAxisRotationMatrix</CODE></a>
165            </th>
166<td>Initializes the rotation matrix to use for transforming the accelerometer's sampling data.</td>
167          </tr>
168          <tr>
169<th class="category" colspan="3">Offset</th>
170          </tr>
171          <tr>
172            <td width="100">  </td>
173            <th>
174<a href="../../../../nn/hid/CTR/AccelerometerReader/EnableOffset.html"><CODE>EnableOffset</CODE></a>
175            </th>
176<td>Enables the accelerometer offset.</td>
177          </tr>
178          <tr>
179            <td width="100">  </td>
180            <th>
181<a href="../../../../nn/hid/CTR/AccelerometerReader/DisableOffset.html"><CODE>DisableOffset</CODE></a>
182            </th>
183<td>Disables the accelerometer offset.</td>
184          </tr>
185          <tr>
186            <td width="100">  </td>
187            <th>
188<a href="../../../../nn/hid/CTR/AccelerometerReader/IsEnableOffset.html"><CODE>IsEnableOffset</CODE></a>
189            </th>
190<td>Checks whether the accelerometer offset is enabled or disabled.</td>
191          </tr>
192          <tr>
193            <td width="100">  </td>
194            <th>
195<a href="../../../../nn/hid/CTR/AccelerometerReader/SetOffset.html"><CODE>SetOffset</CODE></a>
196            </th>
197<td>Sets the accelerometer offset value.</td>
198          </tr>
199          <tr>
200            <td width="100">  </td>
201            <th>
202<a href="../../../../nn/hid/CTR/AccelerometerReader/SetOffsetFromBaseStatus.html"><CODE>SetOffsetFromBaseStatus</CODE></a>
203            </th>
204<td>Sets the accelerometer offset value.</td>
205          </tr>
206          <tr>
207            <td width="100">  </td>
208            <th>
209<a href="../../../../nn/hid/CTR/AccelerometerReader/GetOffset.html"><CODE>GetOffset</CODE></a>
210            </th>
211<td>Gets the accelerometer offset value.</td>
212          </tr>
213          <tr>
214            <td width="100">  </td>
215            <th>
216<a href="../../../../nn/hid/CTR/AccelerometerReader/ResetOffset.html"><CODE>ResetOffset</CODE></a>
217            </th>
218<td>Resets the accelerometer offset value to the default.</td>
219          </tr>
220          <tr>
221<th class="category" colspan="3">Other</th>
222          </tr>
223          <tr>
224            <td width="100">  </td>
225            <th>
226<a href="../../../../nn/hid/CTR/AccelerometerReader/ConvertToAcceleration.html">ConvertToAcceleration</a>
227            </th>
228<td>Converts the raw sampling data from the accelerometer into acceleration values (in g's).</td>
229          </tr> </table>
230      </div>
231    </a>
232<h2>Class Hierarchy</h2>
233    <div class="section">
234<p class="hierarchy"><span>ADLFireWall::NonCopyable</span><br />&nbsp;&nbsp;<b>nn::hid::CTR::AccelerometerReader</b>
235      </p>
236    </div>
237<h2>Revision History</h2>
238    <div class="section">
239      <dl class="history">
240        <dt>2011/03/15</dt>
241<dd>Added note about the possibility of recalibration from the HOME menu.<br />
242        </dd>
243        <dt>2010/12/06</dt>
244<dd>Added explanation of conditions under which sampling stops.<br />
245        </dd>
246        <dt>2010/01/07</dt>
247<dd>Initial version.<br />
248        </dd>
249      </dl>
250    </div>
251  <hr><p>CONFIDENTIAL</p></body>
252</html>
253