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
22      span.virtual_style
23      {
24        font-size			 : 8pt;
25        color				 : white;
26        font-weight			: bold;
27        background			: #0a0;
28        border-left			: solid 1px #0f0;
29        border-top			: solid 1px #0f0;
30        border-right		: solid 1px #060;
31        border-bottom		: solid 1px #060;
32        padding-left		: 2px;
33        padding-right		: 2px;
34      }
35
36      span.protected_style
37      {
38        font-size			 : 8pt;
39        color				 : white;
40        font-weight			: bold;
41        background			: #444;
42        border-left			: solid 1px #ccc;
43        border-top			: solid 1px #ccc;
44        border-right		: solid 1px #222;
45        border-bottom		: solid 1px #222;
46        padding-left		: 2px;
47        padding-right		: 2px;
48      }
49        --></style>
50<title>nn::hid::CTR::AccelerometerReader</title>
51  </head>
52  <body>
53<h1><CODE>nn::hid::CTR::AccelerometerReader</CODE> Class</h1>
54<h2>Syntax</h2>
55    <div class="section">
56      <pre class="definition">class AccelerometerReader : private ADLFireWall::NonCopyable<AccelerometerReader></pre>
57    </div>
58<h2>Description</h2>
59    <div class="section">
60<p>Class for loading sampling data from the accelerometer.</p><h3>Sampling Rate</h3><p>
61The accelerometer is sampled an average of every 10 milliseconds. Use the <a href="../../../../nn/hid/CTR/Gyroscope/Overview.html"><CODE>nn::hid::CTR::Accelerometer</CODE></a> class to know when sampling occurs, allowing you to accurately monitor sampling timing. 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. To avoid this, Nintendo recommends calling the <CODE>nn::hid::CTR::Accelerometer::WaitSampling</CODE> function right after generating a class instance or when recovering from sleep to wait until results have been sampled at least once. This wait time is the same as the sampling frequency, up to a maximum of approximately 10 milliseconds.
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 indicated by the touch screen face</td></tr><tr><th>Z+</th><td>The direction indicated by up on the +Control Pad</td></tr></table></p></div>
66    <a name="function" id="function">
67<h2>Member Functions</h2>
68      <div class="section">
69        <table class="members">
70          <tr>
71<th class="category" colspan="3">Constructors/Destructors</th>
72          </tr>
73          <tr>
74            <td width="100">  </td>
75            <th>
76<a href="../../../../nn/hid/CTR/AccelerometerReader/AccelerometerReader.html">AccelerometerReader</a>
77            </th>
78<td>Constructor.</td>
79          </tr>
80          <tr>
81            <td width="100">  </td>
82            <th>
83<a href="../../../../nn/hid/CTR/AccelerometerReader/~AccelerometerReader.html"><CODE>~AccelerometerReader</CODE></a>
84            </th>
85<td>Destructor.</td>
86          </tr>
87          <tr>
88<th class="category" colspan="3">Reading Sampling Data</th>
89          </tr>
90          <tr>
91            <td width="100">  </td>
92            <th>
93<a href="../../../../nn/hid/CTR/AccelerometerReader/Read.html"><CODE>Read</CODE></a>
94            </th>
95<td>Loads sampling data from the accelerometer starting with the newest samples. Does not load any data that has been previously loaded.</td>
96          </tr>
97          <tr>
98            <td width="100">  </td>
99            <th>
100<a href="../../../../nn/hid/CTR/AccelerometerReader/ReadLatest.html"><CODE>ReadLatest</CODE></a>
101            </th>
102<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>
103          </tr>
104          <tr>
105<th class="category" colspan="3">Control Functions for Acceleration Variation Tolerance</th>
106          </tr>
107          <tr>
108            <td width="100">  </td>
109            <th>
110<a href="../../../../nn/hid/CTR/AccelerometerReader/GetSensitivity.html"><CODE>GetSensitivity</CODE></a>
111            </th>
112<td>Gets the settings for sensitivity and play tolerance for the change in acceleration between samples.</td>
113          </tr>
114          <tr>
115            <td width="100">  </td>
116            <th>
117<a href="../../../../nn/hid/CTR/AccelerometerReader/SetSensitivity.html"><CODE>SetSensitivity</CODE></a>
118            </th>
119<td>Sets the sensitivity and play tolerance for the change in acceleration between samples.</td>
120          </tr>
121          <tr>
122<th class="category" colspan="3">Axial Rotation</th>
123          </tr>
124          <tr>
125            <td width="100">  </td>
126            <th>
127<a href="../../../../nn/hid/CTR/AccelerometerReader/EnableAxisRotation.html"><CODE>EnableAxisRotation</CODE></a>
128            </th>
129<td>Enables axial rotation of the accelerometer.</td>
130          </tr>
131          <tr>
132            <td width="100">  </td>
133            <th>
134<a href="../../../../nn/hid/CTR/AccelerometerReader/DisableAxisRotation.html"><CODE>DisableAxisRotation</CODE></a>
135            </th>
136<td>Disables axial rotation of the accelerometer.</td>
137          </tr>
138          <tr>
139            <td width="100">  </td>
140            <th>
141<a href="../../../../nn/hid/CTR/AccelerometerReader/IsEnableAxisRotation.html"><CODE>IsEnableAxisRotation</CODE></a>
142            </th>
143<td>Checks whether axial rotation is enabled or disabled for the accelerometer.</td>
144          </tr>
145          <tr>
146            <td width="100">  </td>
147            <th>
148<a href="../../../../nn/hid/CTR/AccelerometerReader/SetAxisRotationMatrix.html"><CODE>SetAxisRotationMatrix</CODE></a>
149            </th>
150<td>Specifies the rotation matrix used for axial rotation of the accelerometer's sampling data.</td>
151          </tr>
152          <tr>
153            <td width="100">  </td>
154            <th>
155<a href="../../../../nn/hid/CTR/AccelerometerReader/GetAxisRotationMatrix.html"><CODE>GetAxisRotationMatrix</CODE></a>
156            </th>
157<td>Gets the rotation matrix currently specified to use for axial rotation of the accelerometer's sampling data.</td>
158          </tr>
159          <tr>
160            <td width="100">  </td>
161            <th>
162<a href="../../../../nn/hid/CTR/AccelerometerReader/ResetAxisRotationMatrix.html"><CODE>ResetAxisRotationMatrix</CODE></a>
163            </th>
164<td>Initializes the rotation matrix to use for transforming the accelerometer's sampling data.</td>
165          </tr>
166          <tr>
167<th class="category" colspan="3">Offset.</th>
168          </tr>
169          <tr>
170            <td width="100">  </td>
171            <th>
172<a href="../../../../nn/hid/CTR/AccelerometerReader/EnableOffset.html"><CODE>EnableOffset</CODE></a>
173            </th>
174<td>Enables the accelerometer offset.</td>
175          </tr>
176          <tr>
177            <td width="100">  </td>
178            <th>
179<a href="../../../../nn/hid/CTR/AccelerometerReader/DisableOffset.html"><CODE>DisableOffset</CODE></a>
180            </th>
181<td>Disables the accelerometer offset.</td>
182          </tr>
183          <tr>
184            <td width="100">  </td>
185            <th>
186<a href="../../../../nn/hid/CTR/AccelerometerReader/IsEnableOffset.html"><CODE>IsEnableOffset</CODE></a>
187            </th>
188<td>Checks whether the accelerometer offset is enabled or disabled.</td>
189          </tr>
190          <tr>
191            <td width="100">  </td>
192            <th>
193<a href="../../../../nn/hid/CTR/AccelerometerReader/SetOffset.html"><CODE>SetOffset</CODE></a>
194            </th>
195<td>Sets the accelerometer offset value.</td>
196          </tr>
197          <tr>
198            <td width="100">  </td>
199            <th>
200<a href="../../../../nn/hid/CTR/AccelerometerReader/SetOffsetFromBaseStatus.html"><CODE>SetOffsetFromBaseStatus</CODE></a>
201            </th>
202<td>Sets the accelerometer offset value.</td>
203          </tr>
204          <tr>
205            <td width="100">  </td>
206            <th>
207<a href="../../../../nn/hid/CTR/AccelerometerReader/GetOffset.html"><CODE>GetOffset</CODE></a>
208            </th>
209<td>Gets the accelerometer offset value.</td>
210          </tr>
211          <tr>
212            <td width="100">  </td>
213            <th>
214<a href="../../../../nn/hid/CTR/AccelerometerReader/ResetOffset.html"><CODE>ResetOffset</CODE></a>
215            </th>
216<td>Resets the accelerometer offset value to the default.</td>
217          </tr>
218          <tr>
219<th class="category" colspan="3">Other</th>
220          </tr>
221          <tr>
222            <td width="100">  </td>
223            <th>
224<a href="../../../../nn/hid/CTR/AccelerometerReader/ConvertToAcceleration.html">ConvertToAcceleration</a>
225            </th>
226<td>Converts the raw sampling data from the accelerometer into acceleration values (in g's).</td>
227          </tr> </table>
228      </div>
229    </a>
230<h2>Class Hierarchy</h2>
231    <div class="section">
232<p class="hierarchy"><span>ADLFireWall::NonCopyable</span><br />  <b>nn::hid::CTR::AccelerometerReader</b>
233      </p>
234    </div>
235<h2>Revision History</h2>
236    <div class="section">
237      <dl class="history">
238        <dt>2010/01/07</dt>
239<dd>Initial version.<br />
240        </dd>
241      </dl>
242    </div>
243  <hr><p>CONFIDENTIAL</p></body>
244</html>