10.b. Serial master program
A serial master program used to control the serial slave program is included with the Pololu AVR
Library (see
) in
libpololu-avr\examples\atmegaxx8\3pi-serial-master
. The program is
designed
to
run
on
an
[https://www.pololu.com/product/1227]
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
case
(
char
)0xB4:
calibrate_line_sensors(IR_EMITTERS_ON);
send_calibrated_sensor_values(1);
break
;
case
(
char
)0xB5:
line_sensors_reset_calibration();
break
;
case
(
char
)0xB6:
send_line_position();
break
;
case
(
char
)0xB7:
do_clear();
break
;
case
(
char
)0xB8:
do_print();
break
;
case
(
char
)0xB9:
do_lcd_goto_xy();
break
;
case
(
char
)0xBA:
auto_calibrate();
break
;
case
(
char
)0xBB:
set_pid();
break
;
case
(
char
)0xBC:
stop_pid();
break
;
case
(
char
)0xC1:
m1_forward();
break
;
case
(
char
)0xC2:
m1_backward();
break
;
case
(
char
)0xC5:
m2_forward();
break
;
case
(
char
)0xC6:
m2_backward();
break
;
default
:
clear();
print(
"Bad cmd"
);
lcd_goto_xy(0,1);
print_hex_byte(command);
play(
"o7l16crc"
);
continue
;
// bad command
}
}
}
Pololu 3pi Robot User’s Guide
© 2001–2019 Pololu Corporation
10. Expansion Information
Page 75 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...