0xB6
line position
0
2
Reads all five IR sensors using calibrated
values and estimates the position of a black
line under the robot. The value, which is sent
back as a two-byte integer, is 0 when the
line is under sensor PC0 or farther to the left,
1000 when the line is directly under sensor
PC1, up to 4000 when it is under sensor
PC4 or farther to the right. See
of of the
for the formula used to estimate
position.
0xB7
clear LCD
0
0
Clears the LCD screen on the 3pi.
0xB8
2-9
0
Prints 1-8 characters to the LCD. The first
byte is the length of the following string of
characters, as with the
play
command above.
0xB9
LCD goto xy
2
0
Moves the LCD cursor to x-y coordinates
given by the next two bytes.
0xBA
autocalibrate
0
1
Turns the robot left and right while calibrating.
For use when the robot it positioned over
a line. Returns the character ‘c’ when
complete.
0xBB
start PID
5
0
Sets up PID parameters and begins line
following. The first data byte sets the
maximum motor speed. The next four bytes,
a, b, c, and d, represent the PID parameters.
Specifically, the difference in the motor
speeds will be set to (L-2000)×a/b + D×c/
d, where L is the position of the line as
described above, and D is the derivative of
L. The integral term is not implemented in
this program. See
for more
information on PID line following.
0xBC
stop PID
0
0
Stops PID line following, setting motor
speeds to 0.
0xC1
M1 forward
1
0
Sets motor M1 turning forward with a speed
Pololu 3pi Robot User’s Guide
© 2001–2019 Pololu Corporation
10. Expansion Information
Page 65 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...