Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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.

The examples/ directory of the repository contains more:

ExampleShows
batteryInformation about every brick on USB
drive_squareSynchronised driving
line_followerLight sensor control loop
ultrasonic_avoidAsync program with take
upload_programFile upload
screenshotLCD capture
displayText and images on the LCD
mailbox_chatMessaging
low_levelThe low-level API (runs on the simulator)
simulatorThe high-level API on the simulator
bluetoothBluetooth with tokio (--features bluetooth)
cargo run --example simulator