Cookbook
Complete programs for common robots. Each one uses the standard NXT driving base:
- left wheel on output B, right wheel on output C,
- sensors as noted in each recipe.
All recipes are synchronous for simplicity. Replace .block() with
.await to use them in async code.
- Line follower: light sensor, proportional control
- Obstacle avoidance: ultrasonic sensor, synchronised driving
- Remote control with an on-brick program: messaging with NXC
- Uploading and running programs: a small command-line tool
The examples/ directory of the repository contains more:
| Example | Shows |
|---|---|
battery | Information about every brick on USB |
drive_square | Synchronised driving |
line_follower | Light sensor control loop |
ultrasonic_avoid | Async program with take |
upload_program | File upload |
screenshot | LCD capture |
display | Text and images on the LCD |
mailbox_chat | Messaging |
low_level | The low-level API (runs on the simulator) |
simulator | The high-level API on the simulator |
bluetooth | Bluetooth with tokio (--features bluetooth) |
cargo run --example simulator