| 1 | |
|---|
| 2 | <!DOCTYPE html |
|---|
| 3 | PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
|---|
| 4 | <html> |
|---|
| 5 | <head> |
|---|
| 6 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
|---|
| 7 | |
|---|
| 8 | <!-- |
|---|
| 9 | This HTML is auto-generated from an M-file. |
|---|
| 10 | To make changes, update the M-file and republish this document. |
|---|
| 11 | --> |
|---|
| 12 | <title>OpenGyro</title> |
|---|
| 13 | <meta name="generator" content="MATLAB 7.8"> |
|---|
| 14 | <meta name="date" content="2009-07-20"> |
|---|
| 15 | <meta name="m-file" content="script_OpenGyro"> |
|---|
| 16 | <link type="text/css" rel="stylesheet" href="../../style.css"> |
|---|
| 17 | </head> |
|---|
| 18 | <body> |
|---|
| 19 | <p class="header">RWTH - Mindstorms NXT Toolbox</p> |
|---|
| 20 | <div class="content"> |
|---|
| 21 | <h1>OpenGyro</h1> |
|---|
| 22 | <!--introduction--> |
|---|
| 23 | <p>Initializes and sets the mode of the HiTechnic Gyro sensor</p> |
|---|
| 24 | <!--/introduction--> |
|---|
| 25 | <h2>Contents</h2> |
|---|
| 26 | <div> |
|---|
| 27 | <ul> |
|---|
| 28 | <li><a href="#2">Syntax</a></li> |
|---|
| 29 | <li><a href="#5">Description</a></li> |
|---|
| 30 | <li><a href="#13">Examples</a></li> |
|---|
| 31 | <li><a href="#15">See also</a></li> |
|---|
| 32 | <li><a href="#17">Signature</a></li> |
|---|
| 33 | </ul> |
|---|
| 34 | </div> |
|---|
| 35 | <h2>Syntax<a name="2"></a></h2> |
|---|
| 36 | <p><tt>OpenGyro(port)</tt></p> |
|---|
| 37 | <p><tt>OpenGyro(port, handle)</tt></p> |
|---|
| 38 | <h2>Description<a name="5"></a></h2> |
|---|
| 39 | <p><tt>OpenGyro(port)</tt> initializes the HiTechnic Gyro sensor on the specified sensor port. The value <tt>port</tt> can be addressed by the symbolic constants <tt>SENSOR_1</tt> , <tt>SENSOR_2</tt>, <tt>SENSOR_3</tt> and <tt>SENSOR_4</tt> analog to the labeling on the NXT Brick. |
|---|
| 40 | </p> |
|---|
| 41 | <p>Before the sensor can be used, <tt>CalibrateGyro</tt> has to be called. |
|---|
| 42 | </p> |
|---|
| 43 | <p>With <tt>GetGyro(port)</tt> you can receive Gyro values up to a max. of +/- 360° rotation rate per sec. |
|---|
| 44 | </p> |
|---|
| 45 | <p>The last optional argument can be a valid NXT handle. If none is specified, the default handle will be used (call <tt>COM_SetDefaultNXT</tt> to set one). |
|---|
| 46 | </p> |
|---|
| 47 | <p><b>Note:</b></p> |
|---|
| 48 | <p>For more details on calibration, see help text and examples of <tt>CalibrateGyro</tt>. |
|---|
| 49 | </p> |
|---|
| 50 | <h2>Examples<a name="13"></a></h2><pre class="codeinput"> OpenGyro(SENSOR_2); |
|---|
| 51 | CalibrateGyro(SENSOR_2, <span class="string">'AUTO'</span>); |
|---|
| 52 | speed = GetGyro(SENSOR_2); |
|---|
| 53 | CloseSensor(SENSOR_2); |
|---|
| 54 | </pre><h2>See also<a name="15"></a></h2> |
|---|
| 55 | <p><a href="CalibrateGyro.html">CalibrateGyro</a>, <a href="GetGyro.html">GetGyro</a>, <a href="CloseSensor.html">CloseSensor</a>, <a href="NXT_SetInputMode.html">NXT_SetInputMode</a>, <a href="NXT_GetInputValues.html">NXT_GetInputValues</a>, </p> |
|---|
| 56 | <h2>Signature<a name="17"></a></h2> |
|---|
| 57 | <div> |
|---|
| 58 | <ul> |
|---|
| 59 | <li><b>Author:</b> Rainer Schnitzler, Linus Atorf (see AUTHORS) |
|---|
| 60 | </li> |
|---|
| 61 | <li><b>Date:</b> 2009/04/14 |
|---|
| 62 | </li> |
|---|
| 63 | <li><b>Copyright:</b> 2007-2009, RWTH Aachen University |
|---|
| 64 | </li> |
|---|
| 65 | </ul> |
|---|
| 66 | </div> |
|---|
| 67 | <p class="footer"><br> |
|---|
| 68 | Published with wg_publish; V1.0<br></p> |
|---|
| 69 | </div> |
|---|
| 70 | <!-- |
|---|
| 71 | ##### SOURCE BEGIN ##### |
|---|
| 72 | %% OpenGyro |
|---|
| 73 | % Initializes and sets the mode of the HiTechnic Gyro sensor |
|---|
| 74 | %% |
|---|
| 75 | %% Syntax |
|---|
| 76 | % |OpenGyro(port)| |
|---|
| 77 | %% |
|---|
| 78 | % |OpenGyro(port, handle)| |
|---|
| 79 | %% |
|---|
| 80 | %% Description |
|---|
| 81 | % |OpenGyro(port)| initializes the HiTechnic Gyro sensor on the specified sensor |
|---|
| 82 | % port. The value |port| can be addressed by the symbolic constants |
|---|
| 83 | % |SENSOR_1| , |SENSOR_2|, |SENSOR_3| and |SENSOR_4| analog to the labeling on the NXT Brick. |
|---|
| 84 | %% |
|---|
| 85 | % Before the sensor can be used, |CalibrateGyro| has to be called. |
|---|
| 86 | %% |
|---|
| 87 | % With |GetGyro(port)| you can receive Gyro values up to a max. of +/- 360° |
|---|
| 88 | % rotation rate per sec. |
|---|
| 89 | %% |
|---|
| 90 | % The last optional argument can be a valid NXT handle. If none is |
|---|
| 91 | % specified, the default handle will be used (call |COM_SetDefaultNXT| to |
|---|
| 92 | % set one). |
|---|
| 93 | %% |
|---|
| 94 | %% |
|---|
| 95 | % *Note:* |
|---|
| 96 | %% |
|---|
| 97 | % For more details on calibration, see help text and examples of |
|---|
| 98 | % |CalibrateGyro|. |
|---|
| 99 | %% |
|---|
| 100 | %% Examples |
|---|
| 101 | OpenGyro(SENSOR_2); |
|---|
| 102 | CalibrateGyro(SENSOR_2, 'AUTO'); |
|---|
| 103 | speed = GetGyro(SENSOR_2); |
|---|
| 104 | CloseSensor(SENSOR_2); |
|---|
| 105 | %% |
|---|
| 106 | %% See also |
|---|
| 107 | % CalibrateGyro, GetGyro, CloseSensor, NXT_SetInputMode, NXT_GetInputValues |
|---|
| 108 | %% |
|---|
| 109 | %% Signature |
|---|
| 110 | %% |
|---|
| 111 | % * *Author:* Rainer Schnitzler, Linus Atorf (see AUTHORS) |
|---|
| 112 | % * *Date:* 2009/04/14 |
|---|
| 113 | % * *Copyright:* 2007-2009, RWTH Aachen University |
|---|
| 114 | % |
|---|
| 115 | |
|---|
| 116 | ##### SOURCE END ##### |
|---|
| 117 | --> |
|---|
| 118 | </body> |
|---|
| 119 | </html> |
|---|