| 1 | |
|---|
| 2 | <!DOCTYPE html |
|---|
| 3 | PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"> |
|---|
| 4 | <html xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd"> |
|---|
| 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>SetMotor</title> |
|---|
| 13 | <meta name="generator" content="MATLAB 7.5"> |
|---|
| 14 | <meta name="date" content="2008-01-28"> |
|---|
| 15 | <meta name="m-file" content="script_SetMotor"> |
|---|
| 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>SetMotor</h1> |
|---|
| 22 | <introduction> |
|---|
| 23 | <p>Sets the current motor to use for motor setting commands</p> |
|---|
| 24 | </introduction> |
|---|
| 25 | <h2>Contents</h2> |
|---|
| 26 | <div> |
|---|
| 27 | <ul> |
|---|
| 28 | <li><a href="#1">Syntax</a></li> |
|---|
| 29 | <li><a href="#2">Description</a></li> |
|---|
| 30 | <li><a href="#4">Example</a></li> |
|---|
| 31 | <li><a href="#5">See also</a></li> |
|---|
| 32 | <li><a href="#6">Signature</a></li> |
|---|
| 33 | </ul> |
|---|
| 34 | </div> |
|---|
| 35 | <h2>Syntax<a name="1"></a></h2> |
|---|
| 36 | <p><tt>SetMotor(port)</tt></p> |
|---|
| 37 | <h2>Description<a name="2"></a></h2> |
|---|
| 38 | <p><tt>SetMotor(port)</tt> sets the current motor on the given <tt>port</tt> as the current active motor which can be controlled by <tt>SendMotorSettings</tt>. Changing motor settings take only an effect on the active motor. The value <tt>port</tt> can be addressed by the symbolic constants <tt>MOTOR_A</tt> , <tt>MOTOR_B</tt> and <tt>MOTOR_C</tt> analog to the labeling on the NXT Brick. |
|---|
| 39 | </p> |
|---|
| 40 | <p>The current motor setting can be returned by function <tt>GetMotor</tt>. |
|---|
| 41 | </p> |
|---|
| 42 | <h2>Example<a name="4"></a></h2><pre class="codeinput"> SetMotor(MOTOR_C); |
|---|
| 43 | SetPower(76); |
|---|
| 44 | SetAngleLimit(720); |
|---|
| 45 | SendMotorSettings(); |
|---|
| 46 | </pre><h2>See also<a name="5"></a></h2> |
|---|
| 47 | <p><a href="GetMotor.html">GetMotor</a>, <a href="SendMotorSettings.html">SendMotorSettings</a>, <a href="MOTOR_A.html">MOTOR_A</a>, <a href="MOTOR_B.html">MOTOR_B</a>, <a href="MOTOR_C.html">MOTOR_C</a></p> |
|---|
| 48 | <h2>Signature<a name="6"></a></h2> |
|---|
| 49 | <div> |
|---|
| 50 | <ul> |
|---|
| 51 | <li><b>Author:</b> Linus Atorf, Alexander Behrens (see AUTHORS) |
|---|
| 52 | </li> |
|---|
| 53 | <li><b>Date:</b> 2007/10/15 |
|---|
| 54 | </li> |
|---|
| 55 | <li><b>Copyright:</b> 2007, RWTH Aachen University |
|---|
| 56 | </li> |
|---|
| 57 | </ul> |
|---|
| 58 | </div> |
|---|
| 59 | <p class="footer"><br> |
|---|
| 60 | Published with wg_publish; V1.0<br></p> |
|---|
| 61 | </div> |
|---|
| 62 | <!-- |
|---|
| 63 | ##### SOURCE BEGIN ##### |
|---|
| 64 | %% SetMotor |
|---|
| 65 | % Sets the current motor to use for motor setting commands |
|---|
| 66 | %% |
|---|
| 67 | %% Syntax |
|---|
| 68 | % |SetMotor(port)| |
|---|
| 69 | %% |
|---|
| 70 | %% Description |
|---|
| 71 | % |SetMotor(port)| sets the current motor on the given |port| as the current active motor which can be controlled |
|---|
| 72 | % by |SendMotorSettings|. Changing motor settings take only an effect on the active motor. The |
|---|
| 73 | % value |port| can be addressed by the symbolic constants |MOTOR_A| , |MOTOR_B| and |MOTOR_C| |
|---|
| 74 | % analog to the labeling on the NXT Brick. |
|---|
| 75 | %% |
|---|
| 76 | % The current motor setting can be returned by function |GetMotor|. |
|---|
| 77 | %% |
|---|
| 78 | %% Example |
|---|
| 79 | SetMotor(MOTOR_C); |
|---|
| 80 | SetPower(76); |
|---|
| 81 | SetAngleLimit(720); |
|---|
| 82 | SendMotorSettings(); |
|---|
| 83 | %% |
|---|
| 84 | %% See also |
|---|
| 85 | % GetMotor, SendMotorSettings, MOTOR_A, MOTOR_B, MOTOR_C |
|---|
| 86 | %% |
|---|
| 87 | %% Signature |
|---|
| 88 | %% |
|---|
| 89 | % * *Author:* Linus Atorf, Alexander Behrens (see AUTHORS) |
|---|
| 90 | % * *Date:* 2007/10/15 |
|---|
| 91 | % * *Copyright:* 2007, RWTH Aachen University |
|---|
| 92 | % |
|---|
| 93 | |
|---|
| 94 | ##### SOURCE END ##### |
|---|
| 95 | --> |
|---|
| 96 | </body> |
|---|
| 97 | </html> |
|---|