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<title>ConvertToAcceleration</title> 8 </head> 9 <body> 10<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>::<a href="../../../../nn/hid/CTR/AccelerometerReader/Overview.html">AccelerometerReader</a>::ConvertToAcceleration</CODE> Member Function</h1> 11<h2>Syntax</h2> 12 <div class="section"> 13 <pre class="definition"> 14void ConvertToAcceleration( 15 <a href="../../../../nn/hid/CTR/AccelerationFloat/Overview.html">AccelerationFloat</a> * pAcceleration, 16 <a href="../../../../nn_types/s32.html">s32</a> bufLen, 17 const <a href="../../../../nn/hid/CTR/AccelerometerStatus/Overview.html">AccelerometerStatus</a> * pSamplingData, 18 <a href="../../../../nn_types/s32.html">s32</a> samplingLen = -1 19); 20</pre> 21 </div> 22<h2>Parameters</h2> 23 <div class="section"> 24 <table class="arguments"> 25 <thead> 26 <tr> 27 <td width="15" /> 28<th>Name</th> 29<td>Description</td> 30 </tr> 31 </thead> 32 <tr> 33<td>out</td> 34<th>pAcceleration</th> 35<td>Stores data that has been converted to acceleration values.</td> 36 </tr> 37 <tr> 38<td>in</td> 39<th>bufLen</th> 40<td>Specifies the number of acceleration values that can be stored in <SPAN class="argument">pAcceleration</SPAN>.</td> 41 </tr> 42 <tr> 43<td>in</td> 44<th>pSamplingData</th> 45<td>Sampling data from the accelerometers before conversion.</td> 46 </tr> 47 <tr> 48<td>in</td> 49<th>samplingLen</th> 50<td>Specifies the amount of data for <SPAN class="argument">pSamplingData</SPAN>. If smaller than <SPAN class="argument">bufLen</SPAN>, there will be an assert failure. If left unspecified or if a negative value has been specified, there will be no assert check.</td> 51 </tr> </table> 52 </div> 53<h2>Return Values</h2> 54 <div class="section"> 55None. 56 </div> 57<h2>Description</h2> 58 <div class="section"> 59<p>Converts the raw sampling data from the accelerometers into acceleration values (in g's).</p><p> 60This converts exactly <CODE>bufLen</CODE> number of data items in <CODE>pSamplingData</CODE> to <CODE>pAcceleration</CODE>, so if the <CODE>pSamplingData</CODE> array is smaller than <CODE>bufLen</CODE>, this results in access beyond the bounds of the <CODE>pSamplingData</CODE> array. 61 </p><p> 62Make sure to allocate the <CODE>pSamplingData</CODE> array to be at least <CODE>bufLen</CODE> items long. 63 </p></div> 64<h2>Revision History</h2> 65 <div class="section"> 66 <dl class="history"> 67 <dt>2012/02/22</dt> 68<dd>Added caution about possible invalid memory access.<br /> 69 </dd> 70 <dt>2010/01/07</dt> 71<dd>Initial version.<br /> 72 </dd> 73 </dl> 74 </div> 75 <hr><p>CONFIDENTIAL</p></body> 76</html>