Last modified by Eric Nantel on 2023/01/24 11:36

Show last authors
1 {{html wiki="false" clean="true"}}
2 <body>
3
4 <div id="container">
5 <p align="center"><span class="headlg">SSC-32 General Purpose Sequencer.</span>
6 </p><p align="center">Author: Mike Dvorsky<br>
7 Version: 1.00<br>
8 Date: Jan 15 2008</p>
9 <p align="center"><span class="headmd">Table of Contents</span></p>
10 <table border="0" width="100%">
11 <tbody><tr>
12 <td width="50%" valign="top">
13 <ul class="toc">
14 <li><a href="https://wiki.lynxmotion.com/info/wiki/lynxmotion/view/servo-erector-set-system/ses-electronics/ses-modules/ssc-32/ssc-32-general-purpose-sequencer/#eeweer">EEW, EER commands - EEPROM Write, Read</a>
15 <ul class="toc">
16 <li class="toc"><a href="https://wiki.lynxmotion.com/info/wiki/lynxmotion/view/servo-erector-set-system/ses-electronics/ses-modules/ssc-32/ssc-32-general-purpose-sequencer/#eewform">EEW Format</a></li>
17 <li class="toc"><a href="https://wiki.lynxmotion.com/info/wiki/lynxmotion/view/servo-erector-set-system/ses-electronics/ses-modules/ssc-32/ssc-32-general-purpose-sequencer/#eerform">EER Format</a>
18 <ul class="toc">
19 <li class="toc"><a href="https://wiki.lynxmotion.com/info/wiki/lynxmotion/view/servo-erector-set-system/ses-electronics/ses-modules/ssc-32/ssc-32-general-purpose-sequencer/#seqform">Sequence Format</a></li>
20 <li class="toc"><a href="https://wiki.lynxmotion.com/info/wiki/lynxmotion/view/servo-erector-set-system/ses-electronics/ses-modules/ssc-32/ssc-32-general-purpose-sequencer/#eerhead">Header</a></li>
21 <li class="toc"><a href="https://wiki.lynxmotion.com/info/wiki/lynxmotion/view/servo-erector-set-system/ses-electronics/ses-modules/ssc-32/ssc-32-general-purpose-sequencer/#srvspdl">Servo/Speed List</a></li>
22 <li class="toc"><a href="https://wiki.lynxmotion.com/info/wiki/lynxmotion/view/servo-erector-set-system/ses-electronics/ses-modules/ssc-32/ssc-32-general-purpose-sequencer/#timepwl">Time/Pulse Width List</a></li>
23 </ul>
24 </li>
25 </ul>
26 </li>
27 <li><a href="https://wiki.lynxmotion.com/info/wiki/lynxmotion/view/servo-erector-set-system/ses-electronics/ses-modules/ssc-32/ssc-32-general-purpose-sequencer/#memmap">Memory Map - Sequences in External EEPROM</a>
28 <ul class="toc">
29 <li class="toc"><a href="https://wiki.lynxmotion.com/info/wiki/lynxmotion/view/servo-erector-set-system/ses-electronics/ses-modules/ssc-32/ssc-32-general-purpose-sequencer/#loc01">Location 0-255: Sequencer Pointer Table</a></li>
30 <li class="toc"><a href="https://wiki.lynxmotion.com/info/wiki/lynxmotion/view/servo-erector-set-system/ses-electronics/ses-modules/ssc-32/ssc-32-general-purpose-sequencer/#loc02">Locations 256-32767: Sequence Data</a></li>
31 </ul>
32 </li>
33 <li><a href="https://wiki.lynxmotion.com/info/wiki/lynxmotion/view/servo-erector-set-system/ses-electronics/ses-modules/ssc-32/ssc-32-general-purpose-sequencer/#gennotes">General Notes on Programming EEPROM</a></li>
34 </ul>
35 </td>
36 <td width="50%" valign="top">
37 <ul class="toc">
38 <li><a href="https://wiki.lynxmotion.com/info/wiki/lynxmotion/view/servo-erector-set-system/ses-electronics/ses-modules/ssc-32/ssc-32-general-purpose-sequencer/#seqex">Sequence Example</a>
39 <ul class="toc">
40 <li class="toc"><a href="https://wiki.lynxmotion.com/info/wiki/lynxmotion/view/servo-erector-set-system/ses-electronics/ses-modules/ssc-32/ssc-32-general-purpose-sequencer/#seqpoint">Sequence Pointer Table</a></li>
41 <li class="toc"><a href="https://wiki.lynxmotion.com/info/wiki/lynxmotion/view/servo-erector-set-system/ses-electronics/ses-modules/ssc-32/ssc-32-general-purpose-sequencer/#seqhead">Sequence Header</a></li>
42 <li class="toc"><a href="https://wiki.lynxmotion.com/info/wiki/lynxmotion/view/servo-erector-set-system/ses-electronics/ses-modules/ssc-32/ssc-32-general-purpose-sequencer/#srvspeed">Servo/Speed List</a></li>
43 <li class="toc"><a href="https://wiki.lynxmotion.com/info/wiki/lynxmotion/view/servo-erector-set-system/ses-electronics/ses-modules/ssc-32/ssc-32-general-purpose-sequencer/#timepw">Time/Pulse Width List</a></li>
44 </ul>
45 </li>
46 <li><a href="https://wiki.lynxmotion.com/info/wiki/lynxmotion/view/servo-erector-set-system/ses-electronics/ses-modules/ssc-32/ssc-32-general-purpose-sequencer/#seqcom">Sequencer Commands</a>
47 <ul class="toc">
48 <li class="toc"><a href="https://wiki.lynxmotion.com/info/wiki/lynxmotion/view/servo-erector-set-system/ses-electronics/ses-modules/ssc-32/ssc-32-general-purpose-sequencer/#playstart">Start a player</a></li>
49 <li class="toc"><a href="https://wiki.lynxmotion.com/info/wiki/lynxmotion/view/servo-erector-set-system/ses-electronics/ses-modules/ssc-32/ssc-32-general-purpose-sequencer/#playstop">Stop a player</a></li>
50 <li class="toc"><a href="https://wiki.lynxmotion.com/info/wiki/lynxmotion/view/servo-erector-set-system/ses-electronics/ses-modules/ssc-32/ssc-32-general-purpose-sequencer/#playspd">Change the speed of a player</a></li>
51 <li class="toc"><a href="https://wiki.lynxmotion.com/info/wiki/lynxmotion/view/servo-erector-set-system/ses-electronics/ses-modules/ssc-32/ssc-32-general-purpose-sequencer/#playpau">Change the pause value of a player</a></li>
52 <li class="toc"><a href="https://wiki.lynxmotion.com/info/wiki/lynxmotion/view/servo-erector-set-system/ses-electronics/ses-modules/ssc-32/ssc-32-general-purpose-sequencer/#gotostep">Go to a step in a sequence</a></li>
53 <li class="toc"><a href="https://wiki.lynxmotion.com/info/wiki/lynxmotion/view/servo-erector-set-system/ses-electronics/ses-modules/ssc-32/ssc-32-general-purpose-sequencer/#playque">Query a player</a></li>
54 </ul>
55 </li>
56 <li><a href="https://wiki.lynxmotion.com/info/wiki/lynxmotion/view/servo-erector-set-system/ses-electronics/ses-modules/ssc-32/ssc-32-general-purpose-sequencer/#seqcomex">Examples of Sequencer Commands</a></li>
57 </ul>
58 </td>
59 </tr>
60 </tbody></table>
61 <hr width="95%" color="#808080">
62 <p align="center"><span class="headmd"><a name="eeweer">EEW, EER commands - EEPROM Write, Read.</a></span></p>
63 <p>The EEW and EER commands are used to write and read external EEPROM data. In order for these commands to be used, an EEPROM chip must be
64 installed in the 8-pin socket on the SSC-32. The chip used for testing is a Microchip 24LC256-I/P which has 32768 bytes of storage. Other I<sup>2</sup>C
65 serial EEPROMs with comparable pinout should work, but have not been tested.</p>
66 <p>The primary use of external EEPROM is to store sequences for the General Purpose sequencer. The first 256 bytes of external EEPROM are reserved
67 exclusively for the GP sequencer, but the other bytes may be used for other purposes.</p>
68 <p>EEPROM read and write commands are issued with arguments in decimal format, but the response to an EEPROM read command is in binary format. This
69 is in keeping with the SSC-32 convention of receiving commands in decimal format and providing responses in binary format.</p>
70 <p>NOTE: The current firmware version (SSC32-V2.01GP) requires a '-' character before the address in EEPROM read and write commands. If this
71 character is omitted, the EEPROM access will be performed on internal EEPROM of the ATMega168 processor. Future firmware versions will not require
72 the '-' character for external EEPROM access.</p>
73 <p>NOTE: No external EEPROM read or write accesses should be performed while a sequence is executing out of external EEPROM.</p>
74 <p><span class="headsm"><a name="eewform">EEW Instruction Format</a></span></p>
75 <p>EEW -&lt;addr&gt;,&lt;byte&gt;,&lt;byte&gt;,&lt;byte&gt;,...,&lt;byte&gt;&lt;cr&gt;</p>
76 <ul>
77 <li>&lt;addr&gt; = the starting address of the data to be written, in decimal format</li>
78 <li>&lt;byte&gt; = a byte of data to be written to external EEPROM, in decimal format</li>
79 </ul>
80 <p>The EEW command writes up to 32 bytes of EEPROM. To write more than 32 bytes, issue multiple commands. The command may take several milliseconds
81 to complete. When performing multiple successive EEW commands, it is recommended that you wait for each command to complete before starting the next
82 command. There are several ways to do this:</p>
83 <ul>
84 <li>Delay 10ms between EEW commands.</li>
85 <li>Use an EER command to read back the data just written. The EER command will not return until the EEW has finished.</li>
86 <li>Issue any command that receives a response from the SSC-32. The SSC-32 will not respond to any commands until the EEW command has finished.</li>
87 </ul>
88 <p>Example: write 8 bytes of external EEPROM starting at address 256. Write the values 12, 34, 56, 78, 90, 98, 76, 54.</p>
89 <p>EEW -256, 12, 34, 56, 78, 90, 98, 76, 54&lt;cr&gt;</p>
90 <p>NOTE: The EEW command will complete faster if the starting address is a multiple of 32. If you have a large block of data to write, begin by
91 writing any unaligned portion; then write 32-byte aligned blocks; finally write any remaining unaligned portion.</p>
92 <p><span class="headsm"><a name="eerform">EER Instruction Format</a></span></p>
93 <p>EER &lt;addr&gt; ; &lt;nbytes&gt;</p>
94 <ul>
95 <li>&lt;addr&gt; = the starting address of the data to be written, in decimal format</li>
96 <li>&lt;nBytes&gt; = the number of bytes to read, in decimal format</li>
97 </ul>
98 <p>The EER command reads up to 32 bytes of EEPROM. To read more than 32 bytes, issue multiple commands. The return value from the EER command is a
99 string of bytes, in binary format.</p>
100 <p>Example: read 8 bytes of external EEPROM starting at address 256. (Assume the values in EEPROM are the values programmed in the previous
101 example.)</p>
102 <p>EER -256;8&lt;cr&gt;<br>
103 result: 12 34 56 78 90 98 76 54 (binary)</p>
104 <hr width="95%" color="#808080">
105 <p align="center"><span class="headmd"><a name="memmap">Memory Map - Sequences in External EEPROM</a></span></p>
106 <p>Sequences stored in external EEPROM must follow a defined format, as described below. The first 256 bytes are reserved for the Sequence Pointer
107 Table, but the remaining bytes may be used for other purposes, as long as they are not part of a sequence pointed to by an entry in the Sequence
108 Pointer Table.</p>
109 <p><span class="headsm"><a name="loc01">Locations 0 - 255: Sequence Pointer Table</a></span></p>
110 <p>The Sequence Pointer Table contains the addresses of the sequence starting locations in EEPROM. Valid starting addresses are 256 - 32767. If
111 there is no sequence for a particular sequence number, the Sequence Pointer Table entry should be 0 or 65535. The addresses are stored in big-endian
112 format, with the high byte in the lower address.</p>
113 <p>@0:1 = pointer to sequence 0 (high byte in address 0, low byte in address 1)<br>
114 @2:3 = pointer to sequence 1<br>
115 @4:5 = pointer to sequence 2<br>
116 @6:7 = pointer to sequence 3<br>
117 Etc., up to sequence 127</p>
118 <p><span class="headsm"><a name="loc02">Locations 256 - 32767: Sequence Data</a></span></p>
119 <p>The sequence pointer table entries point to sequence data. Sequences may be stored at any location, but the only way a sequence can be accessed
120 is through the Sequence Pointer Table.</p>
121 <p><span class="headsmi"><a name="seqform">Sequence format</a></span></p>
122 <p>Each sequence has 3 contiguous sections</p>
123 <ul>
124 <li>Header - containing the sequence number, number of servos, and number of steps</li>
125 <li>Servo/speed list - containing a list of all the servos and the maximum move speed for each servo</li>
126 <li>Time/pulse width list - containing the move time and pulse widths for each step</li>
127 </ul>
128 <p><span class="headsmi"><a name="eerhead">Header</a></span></p>
129 <p>The header consists of 3 bytes</p>
130 <ul>
131 <li>Sequence number</li>
132 <li>Number of servos</li>
133 <li>Number of steps</li>
134 </ul>
135 <p>The sequence number must match the sequence number of the Sequence Pointer Table entry. The number of servos may be from 1 to 32. The number of
136 steps may be from 1 to 255.</p>
137 <p><span class="headsmi"><a name="srvspdl">Servo/Speed List</a></span></p>
138 <p>The servo/speed list consists of 3 bytes per servo. The size of the servo/speed list must match the number of servos in the header.</p>
139 <ul>
140 <li>Servo number for 1st servo</li>
141 <li>Speed high byte for 1st servo</li>
142 <li>Speed low byte for 1st servo</li>
143 <li>Servo number for 2nd servo</li>
144 <li>Speed high byte for 2nd servo</li>
145 <li>Speed low byte for 2nd servo</li>
146 <li>Etc.</li>
147 </ul>
148 <p>The servo numbers must be 0-31. Speeds are 0-65535 us/second just like move commands.</p>
149 <p><span class="headsmi"><a name="timepwl">Time/Pulse Width List</a></span></p>
150 <p>The Time/Pulse Width List specifies the servo positions (a.k.a. pulse widths) for each step in the sequence, and the amount of time to move from
151 step to step. The list alternates between servo pulse widths and move times. It begins and ends with a move time.</p>
152 <ul>
153 <li>Step (N-1) -&gt; 0 Time</li>
154 <li>Step 0 PW, PW,..., PW (one PW for each servo)</li>
155 <li>Step 0 -&gt; 1 Time</li>
156 <li>Step 1 PW, PW,..., PW</li>
157 <li>Step 1 -&gt; 2 Time</li>
158 <li>. . .</li>
159 <li>Step (N-1) PW, PW,..., PW</li>
160 <li>Step (N-1) -&gt; 0 Time</li>
161 </ul>
162 <p>If there are M servos and N steps in a sequence, the time/pulse width list consists of 2*(M+1)*N + 2 bytes.</p>
163 <p>There are several things to note about the time/pulse width list:</p>
164 <ol>
165 <li>The Step (N-1) -&gt; 0 move time is duplicated, appearing at the beginning and the end of the list. This makes it easier for the SSC-32 to play
166 sequences in reverse.</li>
167 <li>Move times are in ms, just like move commands.</li>
168 <li>Move times are 2 bytes each, with the high byte appearing first (i.e. big-endian).</li>
169 <li>The move times should be the times for a normal move speed. The speed can be adjusted faster or slower as the sequence is played. The range of
170 adjustment is from 0 to 200% of the programmed speed, either forward or reverse.</li>
171 <li>Pulse widths are in us, just like move commands.</li>
172 <li>Pulse widths are 2 bytes each, big-endian.</li>
173 <li>The pulse width entries for each step must exactly match the list of servo numbers in the servo/speed list.</li>
174 </ol>
175 <hr width="95%" color="#808080">
176 <p align="center"><span class="headmd"><a name="gennotes">General notes on programming EEPROM.</a></span></p>
177 <ul>
178 <li>Write no more than 32 bytes at a time. For the fastest write speed with external EEPROM, make as many writes as possible start on a 32-byte
179 boundary. For example, to write a 1000-byte block starting at address 500, begin by writing bytes 500-511 in a single 12-byte write. Then do 30
180 writes of 32 bytes each--these writes will all start on 32-byte boundaries. Finally, write the last 28 bytes in a single write.</li>
181 <li>After writing sequences to external EEPROM, it is recommended that you verify the contents of external EEPROM by reading back the bytes
182 written.</li>
183 <li>Bytes of external EEPROM can be used for other purposes than storing sequences, as long as no Sequence Pointer Table entries point to these
184 bytes. For example, a portion of EEPROM could be reserved for storage of text strings describing the sequences. This way, when the sequences are
185 read out of EEPROM, there will be some clue to what the sequence is intended to do.</li>
186 </ul>
187 <hr width="95%" color="#808080">
188 <p align="center"><span class="headmd"><a name="seqex">Sequence Examples</a></span></p>
189 <p>Here is a simple example of a sequence. The sequence will move 2 servos through 3 steps. The servos will be servo #9 and servo #10. The steps
190 will be:</p>
191 <p>Step 0: Servo #9 = 1500us, servo #10 = 1500us<br>
192 Step 1: Servo #9 = 1000us, servo #10 = 1500us<br>
193 Step 2: Servo #9 = 1000us, servo #10 = 2000us</p>
194 <p>Moving from step 0 to step 1 will take 600ms, from step 1 to step 2 will take 1200ms, and from step 2 to step 0 will take 2400ms.</p>
195 <p>The sequence number will be 5, and it will be stored beginning at EEPROM address 500.</p>
196 <p><span class="headsm"><a name="seqpoint">Sequence Pointer Table</a></span></p>
197 <p>First, the Sequence Pointer Table must be set so that sequence 5 begins at address 500. Sequence 5 begins at EEPROM address 10. When the number
198 500 is split into 2 bytes, the high order byte is 1 and the low order byte is 244 (500 = 1*256 + 244), so the Sequence Pointer Table value starting
199 at address 10 will be</p>
200 <p>@10 = 1<br>
201 @11 = 244</p>
202 <p>The EEW command to write this portion of the Sequence Pointer table is<br>
203 EEW -10, 1, 244</p>
204 <p><span class="headsm"><a name="seqhead">Sequence Header</a></span></p>
205 <p>The sequence header is 3 bytes that specify the sequence number (5), number of servos (2), and number of steps (3). The sequence header begins at
206 EEPROM address 500:</p>
207 <p>@500 = 5<br>
208 @501 = 2<br>
209 @502 = 3</p>
210 <p>The EEW command to write the sequence header is<br>
211 EEW -500, 5, 2, 3</p>
212 <p><span class="headsm"><a name="srvspeed">Servo/Speed List</a></span></p>
213 <p>The servo/speed list has 3 bytes per servo (1 byte servo number, 2 bytes maximum speed). For this sequence, the maximum speeds will be 65535 =
214 255*256 + 255. The servo/speed list begins immediately after the sequence header, at address 503:</p>
215 <p>@503 = 9<br>
216 @504 = 255<br>
217 @505 = 255<br>
218 @506 = 10<br>
219 @507 = 255<br>
220 @508 = 255</p>
221 <p>The EEW command to write the sequence header is<br>
222 EEW -503, 9, 255, 255, 10, 255, 255</p>
223 <p><span class="headsm"><a name="timepw">Time/Pulse Width List</a></span></p>
224 <p>The time/pulse width list has the servo pulse widths for each step, and the times to move between the steps. The servo pulse widths in this
225 example are</p>
226 <ul>
227 <li>1000 = 3*256 + 232</li>
228 <li>1500 = 5*256 + 220</li>
229 <li>2000 = 7*256 + 208</li>
230 </ul>
231 <p>The move times in this example are</p>
232 <ul>
233 <li>600 = 2*256 + 88</li>
234 <li>1200 = 4*256 + 176</li>
235 <li>2400 = 9*256 + 96</li>
236 </ul>
237 <p>The time/pulse width list begins immediately after the servo/speed list, at address 509:</p>
238 <p>@509 = 9 Step 2 to step 0 time = 2400<br>
239 @510 = 96<br>
240 @511 = 5 Step 0, servo 9 = 1500<br>
241 @512 = 220<br>
242 @513 = 5 Step 0, servo 10 = 1500<br>
243 @514 = 220<br>
244 @515 = 2 Step 0 to step 1 time = 600<br>
245 @516 = 88<br>
246 @517 = 3 Step 1, servo 9 = 1000<br>
247 @518 = 232<br>
248 @519 = 5 Step 1, servo 10 = 1500<br>
249 @520 = 220<br>
250 @521 = 4 Step 1 to step 2 time = 120<br>
251 @522 = 176<br>
252 @523 = 3 Step 2, servo 9 = 1000<br>
253 @524 = 232<br>
254 @525 = 7 Step 2, servo 10 = 2000<br>
255 @526 = 208<br>
256 @527 = 9 Step 2 to step 0 time = 2400<br>
257 @528 = 96</p>
258 <p>The EEW command to write the time/pulse width list is<br>
259 EEW -509, 9,96,5,220,5,220,2,88,3,232,5,220,4,176,3,232,7,208,9,96</p>
260 <hr width="95%" color="#808080">
261 <p align="center"><span class="headmd"><a name="seqcom">Sequencer Commands</a></span></p>
262 <p>These are the commands that allow you to play programmed sequences. The SSC-32 has two "players" that can each play a sequence. The players
263 may be used simultaneously, and other servo move commands may be sent to the SSC-32 while players are playing.</p>
264 <p>NOTE: Do not simultaneously play two sequences that use some of the same servos. The results will be unpredictable.</p>
265 <p>NOTE: Do not issue servo move commands that use servos in a playing sequence. The results will be unpredictable.</p>
266 <p><span class="headsm"><a name="playstart">Start a player</a></span></p>
267 <p>The following command starts a player playing a specified sequence, with several parameters.</p>
268 <p>(The notation &lt;x&gt; indicates a number that is one of the parameters to the command. The notation "[xxx]" indicates an optional part of
269 the command.)</p>
270 <p>PL &lt;p&gt; SQ &lt;s&gt; [SM &lt;m&gt;] [IX &lt;i&gt;] [PA &lt;pa&gt;] [ONCE]</p>
271 <ul>
272 <li>PL &lt;p&gt; Specifies player p, either 0 or 1</li>
273 <li>SQ &lt;s&gt; Specifies sequence number s, from 0 to 127</li>
274 <li>SM &lt;m&gt; Specifies speed multiplier m, from -200 to 200</li>
275 <li>IX &lt;i&gt; Specifies starting index i (a.k.a. step number), from 0 to 255</li>
276 <li>PA &lt;a&gt; Specifies pause between steps, a, in milliseconds from 0 to 65535</li>
277 <li>ONCE Specifies that the sequence is played only one time</li>
278 </ul>
279 <p>The SM value is a percentage of the speed based on the move times in the programmed sequence. The larger the number the faster the sequence
280 plays, up to 2 times the speed of the programmed sequence (for a speed multiplier of 200%). If the SM value is negative, the sequence is played in
281 reverse. The SM value does NOT affect the maximum speeds for the servos. If SM is not specified, it defaults to 100%.</p>
282 <p>The IX value specifies which step should be first when the sequence is started. The player will attempt to move the servos gradually to the
283 starting position. If IX is not specified, it defaults to 0.</p>
284 <p>The PA value specifies the length of a pause that is inserted between steps in the sequence. The value is in milliseconds. If PA is not
285 specified, it defaults to 0.</p>
286 <p>The ONCE option specifies that the sequence is played only one time, and then the player stops. The servos will start and end at the position
287 specified by the IX parameter (or 0 if IX is not specified). If ONCE is not specified, the sequence will repeat continuously until the player is
288 stopped by a user command.</p>
289 <p><span class="headsm"><a name="playstop">Stop a player</a></span></p>
290 <p>The following command stops a player immediately.</p>
291 <p>PL &lt;p&gt;</p>
292 <p><span class="headsm"><a name="playspd">Change the speed of a player</a></span></p>
293 <p>The following command changes the speed of a player. The player must already be playing a sequence for this command to be valid.</p>
294 <p>It is possible to set the speed to 0. In this case, the servos will stop moving but the sequence will still be playing and can be restarted by
295 changing the speed to a non-zero value.</p>
296 <p>PL &lt;p&gt; SM &lt;m&gt;</p>
297 <p><span class="headsm"><a name="playpau">Change the pause value of a player</a></span></p>
298 <p>The following command changes the pause value of a player. The player must already be playing a sequence for this command to be valid.</p>
299 <p>PL &lt;p&gt; PA &lt;pa&gt;</p>
300 <p><span class="headsm"><a name="gotostep">Go to a step in a sequence</a></span></p>
301 <p>The following command causes a group of servos to move to one of the steps in a sequence. The step number and move time can be optionally
302 specified. This command is equivalent to a normal group move command, except that the servos and maximum speeds are obtained from the specified
303 sequence. The T parameter in this command works exactly like the T parameter in a normal group move command.</p>
304 <p>NOTE: This command is independent of any player, and may be issued even if both players are playing sequences. Like any servo move command, this
305 command should not be used if it will cause servos to move that are part of a currently playing sequence. The results will be unpredictable.</p>
306 <p>SQ &lt;p&gt; [IX &lt;i&gt;] [T &lt;t&gt;]</p>
307 <p><span class="headsm"><a name="playque">Query a player</a></span></p>
308 <p>The following command causes the SSC-32 to return information about the state of a player.</p>
309 <p>QPL &lt;p&gt;</p>
310 <p>The QPL command returns 4 bytes of binary information:</p>
311 <ol>
312 <li>The sequence number being played (or 255 if no sequence is being played)</li>
313 <li>The index moving from in the sequence (0 through the maximum step number)</li>
314 <li>The index moving to in the sequence</li>
315 <li>The remaining time in the step, 100ms per bit (e.g. if there are 700ms remaining, the value will be 7)</li>
316 </ol>
317 <hr width="95%" color="#808080">
318 <p align="center"><span class="headmd"><a name="seqcomex">Examples of Sequencer Commands</a></span></p>
319 <p>Start player 0 playing sequence 5. Start at step 0, 100% forward speed, no pause between steps, play continuously.<br>
320 PL 0 SQ 5</p>
321 <p>Change the speed of player 0 to 50% reverse speed.<br>
322 PL 0 SM -50</p>
323 <p>Pause player 0 (set the speed to 0)<br>
324 PL 0 SM 0</p>
325 <p>Change the speed of player 0 to 200% forward speed.<br>
326 PL 0 SM 200</p>
327 <p>Change the pause between steps for player 0 to 1000ms (1 second).<br>
328 PL 0 PA 1000</p>
329 <p>Stop player 0.<br>
330 PL 0</p>
331 <p>Go to step 3 of sequence 20.<br>
332 SQ 20 IX 3</p>
333 <p>Go to step 5 of sequence 20, taking 2000ms (2 seconds).<br>
334 SQ 20 IX 5 T 2000</p>
335 <p>Start player 1 playing sequence 15. Start at step 2, 70% reverse speed, play one time only.<br>
336 PL 1 SQ 15 IX 2 SM -70 ONCE
337 </p></div>
338 </body>
339 {{/html}}
Copyright RobotShop 2018