249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
set_m1_speed(byte == 127 ? -255 : -byte*2);
}
// Drives m2 backward.
void
m2_backward()
{
char
byte = read_next_byte();
if
(check_data_byte(byte))
return
;
set_m2_speed(byte == 127 ? -255 : -byte*2);
}
// A buffer to store the music that will play in the background.
char
music_buffer[100];
// Plays a musical sequence.
void
do_play()
{
unsigned
char
tune_length = read_next_byte();
if
(check_data_byte(tune_length))
return
;
unsigned
char
i;
for
(i=0;i<tune_length;i++)
{
if
(i >
sizeof
(music_buffer))
// avoid overflow
return
;
music_buffer[i] = read_next_byte();
if
(check_data_byte(music_buffer[i]))
return
;
}
// add the end of string character 0
music_buffer[i] = 0;
play(music_buffer);
}
// Clears the LCD
void
do_clear()
{
clear();
}
// Displays data to the screen
void
do_print()
{
unsigned
char
string_length = read_next_byte();
if
(check_data_byte(string_length))
return
;
unsigned
char
i;
for
(i=0;i<string_length;i++)
{
unsigned
char
character;
Pololu 3pi Robot User’s Guide
© 2001–2019 Pololu Corporation
10. Expansion Information
Page 72 of 85
Содержание 0J5840
Страница 24: ...Pololu 3pi Robot User s Guide 2001 2019 Pololu Corporation 5 How Your 3pi Works Page 24 of 85...
Страница 67: ...Source code Pololu 3pi Robot User s Guide 2001 2019 Pololu Corporation 10 Expansion Information Page 67 of 85...
Страница 77: ...Source code Pololu 3pi Robot User s Guide 2001 2019 Pololu Corporation 10 Expansion Information Page 77 of 85...