Lesson 4 of 9 ยท about 20 minutes
Now the robot sends news back, and a 3D robot on the screen copies the real one.
On connect, the page asks ! T 1: "tell me what you are doing".
Then about eight times a second the robot sends a ten-byte telemetry packet:
| Bytes | Means | Here |
|---|---|---|
7B 00 | Heading, tenths of a degree, left = up | 12.3ยฐ left |
17 | Distance ahead, cm (255 = nothing) | 23 cm |
24 | Lights: a bit each for R, G, B, left then right | both blue |
41 | Speed, fifths of a cm/s | 13 cm/s |
00 | Turning, 3ยฐ/s steps | not turning |
03 | Turbo, bumper, blocked, dancing | turbo, bumper |
Heading comes from odometry: counting how far each wheel has turned. No compass.
On the robot, TELEMETRY_MS = 100 sets how often it sends news. Try 500 and watch the
3D robot move in steps.