<divclass="textblock"><p>This class parses all the data sent by the PS5 controller </p>
<pclass="definition">Definition at line <aclass="el"href="_p_s5_parser_8h_source.html#l00149">149</a> of file <aclass="el"href="_p_s5_parser_8h_source.html">PS5Parser.h</a>.</p>
</div><h2class="groupheader">Constructor & Destructor Documentation</h2>
<p>Constructor for the <aclass="el"href="class_p_s5_parser.html">PS5Parser</a> class. </p>
<pclass="definition">Definition at line <aclass="el"href="_p_s5_parser_8h_source.html#l00152">152</a> of file <aclass="el"href="_p_s5_parser_8h_source.html">PS5Parser.h</a>.</p>
</div>
</div>
<h2class="groupheader">Member Function Documentation</h2>
<p><aclass="el"href="class_p_s5_parser.html#a481808a0aecbee31d0fa52343a8d87a0">getButtonPress(ButtonEnum b)</a> will return true as long as the button is held down.</p>
<p>While <aclass="el"href="class_p_s5_parser.html#a4b8f61bc96190a433ab59821adaf4b33">getButtonClick(ButtonEnum b)</a> will only return it once.</p>
<p>So you instance if you need to increase a variable once you would use <aclass="el"href="class_p_s5_parser.html#a4b8f61bc96190a433ab59821adaf4b33">getButtonClick(ButtonEnum b)</a>, but if you need to drive a robot forward you would use <aclass="el"href="class_p_s5_parser.html#a481808a0aecbee31d0fa52343a8d87a0">getButtonPress(ButtonEnum b)</a>. </p><dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">b</td><td><aclass="el"href="controller_enums_8h.html#a94f7389d205c78830a5441370d7870fd">ButtonEnum</a> to read. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd><aclass="el"href="class_p_s5_parser.html#a481808a0aecbee31d0fa52343a8d87a0">getButtonPress(ButtonEnum b)</a> will return a true as long as a button is held down, while <aclass="el"href="class_p_s5_parser.html#a4b8f61bc96190a433ab59821adaf4b33">getButtonClick(ButtonEnum b)</a> will return true once for each button press. </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="_p_s5_parser_8cpp_source.html#l00060">60</a> of file <aclass="el"href="_p_s5_parser_8cpp_source.html">PS5Parser.cpp</a>.</p>
<p><aclass="el"href="class_p_s5_parser.html#a481808a0aecbee31d0fa52343a8d87a0">getButtonPress(ButtonEnum b)</a> will return true as long as the button is held down.</p>
<p>While <aclass="el"href="class_p_s5_parser.html#a4b8f61bc96190a433ab59821adaf4b33">getButtonClick(ButtonEnum b)</a> will only return it once.</p>
<p>So you instance if you need to increase a variable once you would use <aclass="el"href="class_p_s5_parser.html#a4b8f61bc96190a433ab59821adaf4b33">getButtonClick(ButtonEnum b)</a>, but if you need to drive a robot forward you would use <aclass="el"href="class_p_s5_parser.html#a481808a0aecbee31d0fa52343a8d87a0">getButtonPress(ButtonEnum b)</a>. </p><dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">b</td><td><aclass="el"href="controller_enums_8h.html#a94f7389d205c78830a5441370d7870fd">ButtonEnum</a> to read. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd><aclass="el"href="class_p_s5_parser.html#a481808a0aecbee31d0fa52343a8d87a0">getButtonPress(ButtonEnum b)</a> will return a true as long as a button is held down, while <aclass="el"href="class_p_s5_parser.html#a4b8f61bc96190a433ab59821adaf4b33">getButtonClick(ButtonEnum b)</a> will return true once for each button press. </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="_p_s5_parser_8cpp_source.html#l00068">68</a> of file <aclass="el"href="_p_s5_parser_8cpp_source.html">PS5Parser.cpp</a>.</p>
<p>Used to get the analog value from button presses. </p><dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">b</td><td>The <aclass="el"href="controller_enums_8h.html#a94f7389d205c78830a5441370d7870fd">ButtonEnum</a> to read. The supported buttons are: <aclass="el"href="controller_enums_8h.html#a94f7389d205c78830a5441370d7870fda0adffb24dae0c41be5b803f4d444f066">L2</a> and <aclass="el"href="controller_enums_8h.html#a94f7389d205c78830a5441370d7870fda629d7b403cea5f826352f3aefb9a6d6a">R2</a>. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>Analog value in the range of 0-255. </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="_p_s5_parser_8cpp_source.html#l00076">76</a> of file <aclass="el"href="_p_s5_parser_8cpp_source.html">PS5Parser.cpp</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="_p_s5_parser_8cpp_source.html#l00085">85</a> of file <aclass="el"href="_p_s5_parser_8cpp_source.html">PS5Parser.cpp</a>.</p>
<p>Get the x-coordinate of the touchpad. Position 0 is in the top left. </p><dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">finger</td><td>0 = first finger, 1 = second finger. If omitted, then 0 will be used. </td></tr>
</table>
</dd>
</dl>
<pclass="definition">Definition at line <aclass="el"href="_p_s5_parser_8h_source.html#l00194">194</a> of file <aclass="el"href="_p_s5_parser_8h_source.html">PS5Parser.h</a>.</p>
<p>Get the y-coordinate of the touchpad. Position 0 is in the top left. </p><dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">finger</td><td>0 = first finger, 1 = second finger. If omitted, then 0 will be used. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>Returns the y-coordinate of the finger. </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="_p_s5_parser_8h_source.html#l00203">203</a> of file <aclass="el"href="_p_s5_parser_8h_source.html">PS5Parser.h</a>.</p>
<p>Returns whenever the user is toucing the touchpad. </p><dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">finger</td><td>0 = first finger, 1 = second finger. If omitted, then 0 will be used. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>Returns true if the specific finger is touching the touchpad. </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="_p_s5_parser_8h_source.html#l00212">212</a> of file <aclass="el"href="_p_s5_parser_8h_source.html">PS5Parser.h</a>.</p>
<p>This counter increments every time a finger touches the touchpad. </p><dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">finger</td><td>0 = first finger, 1 = second finger. If omitted, then 0 will be used. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>Return the value of the counter, note that it is only a 7-bit value. </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="_p_s5_parser_8h_source.html#l00221">221</a> of file <aclass="el"href="_p_s5_parser_8h_source.html">PS5Parser.h</a>.</p>
<p>Get the angle of the controller calculated using the accelerometer. </p><dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">a</td><td>Either <aclass="el"href="controller_enums_8h.html#a7c7824a10a9ffa8fea85602fcf4d84e6ae3a34b760fa4a6854f28852e91d8bb47">Pitch</a> or <aclass="el"href="controller_enums_8h.html#a7c7824a10a9ffa8fea85602fcf4d84e6a9d80e5f030503ccac779c6491826a173">Roll</a>. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>Return the angle in the range of 0-360. </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="_p_s5_parser_8h_source.html#l00230">230</a> of file <aclass="el"href="_p_s5_parser_8h_source.html">PS5Parser.h</a>.</p>
<p>Used to get the raw values from the 3-axis gyroscope and 3-axis accelerometer inside the PS5 controller. </p><dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">s</td><td>The sensor to read. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>Returns the raw sensor reading. </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="_p_s5_parser_8h_source.html#l00242">242</a> of file <aclass="el"href="_p_s5_parser_8h_source.html">PS5Parser.h</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="_p_s5_parser_8h_source.html#l00298">298</a> of file <aclass="el"href="_p_s5_parser_8h_source.html">PS5Parser.h</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="_p_s5_parser_8h_source.html#l00304">304</a> of file <aclass="el"href="_p_s5_parser_8h_source.html">PS5Parser.h</a>.</p>
<p>Turn on rumble. </p><dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">mode</td><td>Either <aclass="el"href="controller_enums_8h.html#ab195293384292950ebc2166bfe360fd1a5819f165165589a8e65b07bf46c7382b">RumbleHigh</a> or <aclass="el"href="controller_enums_8h.html#ab195293384292950ebc2166bfe360fd1a080b52389e532b79b9e48f43ae6086ac">RumbleLow</a>. </td></tr>
</table>
</dd>
</dl>
<pclass="definition">Definition at line <aclass="el"href="_p_s5_parser_8h_source.html#l00312">312</a> of file <aclass="el"href="_p_s5_parser_8h_source.html">PS5Parser.h</a>.</p>
<p>Turn on rumble. </p><dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">bigRumble</td><td>Value for big motor. </td></tr>
<tr><tdclass="paramname">smallRumble</td><td>Value for small motor. </td></tr>
</table>
</dd>
</dl>
<pclass="definition">Definition at line <aclass="el"href="_p_s5_parser_8h_source.html#l00324">324</a> of file <aclass="el"href="_p_s5_parser_8h_source.html">PS5Parser.h</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="_p_s5_parser_8h_source.html#l00331">331</a> of file <aclass="el"href="_p_s5_parser_8h_source.html">PS5Parser.h</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="_p_s5_parser_8h_source.html#l00339">339</a> of file <aclass="el"href="_p_s5_parser_8h_source.html">PS5Parser.h</a>.</p>
<p>Use this to set the color using the predefined colors in <aclass="el"href="controller_enums_8h.html#aac6fa7b0395b95cc528deaad0ce884a2">ColorsEnum</a>. </p><dlclass="params"><dt>Parameters</dt><dd>
<pclass="definition">Definition at line <aclass="el"href="_p_s5_parser_8h_source.html#l00350">350</a> of file <aclass="el"href="_p_s5_parser_8h_source.html">PS5Parser.h</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="_p_s5_parser_8h_source.html#l00355">355</a> of file <aclass="el"href="_p_s5_parser_8h_source.html">PS5Parser.h</a>.</p>
<p>Use this to set five player LEDs. </p><dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">mask</td><td>Bit mask to set the five player LEDs. The first 5 bits represent a LED each. </td></tr>
</table>
</dd>
</dl>
<pclass="definition">Definition at line <aclass="el"href="_p_s5_parser_8h_source.html#l00363">363</a> of file <aclass="el"href="_p_s5_parser_8h_source.html">PS5Parser.h</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="_p_s5_parser_8h_source.html#l00369">369</a> of file <aclass="el"href="_p_s5_parser_8h_source.html">PS5Parser.h</a>.</p>
<p>Use this to turn the microphone LED on/off. </p><dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">on</td><td>Turn the microphone LED on/off. </td></tr>
</table>
</dd>
</dl>
<pclass="definition">Definition at line <aclass="el"href="_p_s5_parser_8h_source.html#l00377">377</a> of file <aclass="el"href="_p_s5_parser_8h_source.html">PS5Parser.h</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="_p_s5_parser_8h_source.html#l00383">383</a> of file <aclass="el"href="_p_s5_parser_8h_source.html">PS5Parser.h</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="_p_s5_parser_8cpp_source.html#l00089">89</a> of file <aclass="el"href="_p_s5_parser_8cpp_source.html">PS5Parser.cpp</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="_p_s5_parser_8cpp_source.html#l00149">149</a> of file <aclass="el"href="_p_s5_parser_8cpp_source.html">PS5Parser.cpp</a>.</p>
<p>Send the output to the PS5 controller. This is implemented in <aclass="el"href="_p_s5_b_t_8h.html">PS5BT.h</a> and <aclass="el"href="_p_s5_u_s_b_8h.html">PS5USB.h</a>. </p><dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">output</td><td>Pointer to <aclass="el"href="struct_p_s5_output.html">PS5Output</a> buffer; </td></tr>
</table>
</dd>
</dl>
<p>Implemented in <aclass="el"href="class_p_s5_b_t.html#a1c55a37b59d84c204c3460f2163b06fa">PS5BT</a>, and <aclass="el"href="class_p_s5_u_s_b.html#a2d64e8b4db4729a7370cc4a191c8399c">PS5USB</a>.</p>
</div>
</div>
<h2class="groupheader">Member Data Documentation</h2>
<p>Used these to manipulate the haptic triggers </p>
<pclass="definition">Definition at line <aclass="el"href="_p_s5_parser_8h_source.html#l00154">154</a> of file <aclass="el"href="_p_s5_parser_8h_source.html">PS5Parser.h</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="_p_s5_parser_8h_source.html#l00157">157</a> of file <aclass="el"href="_p_s5_parser_8h_source.html">PS5Parser.h</a>.</p>