| Crates.io | ev3dev-rs |
| lib.rs | ev3dev-rs |
| version | 0.2.1 |
| created_at | 2026-01-24 03:03:14.199296+00 |
| updated_at | 2026-01-24 18:54:28.912621+00 |
| description | High level pybricks-like rust bindings for e3dev |
| homepage | |
| repository | https://github.com/shaggysa/ev3dev-rs |
| max_upload_size | |
| id | 2065972 |
| size | 125,450 |
extern crate ev3dev_rs;
extern crate tokio;
use ev3dev_rs::Ev3Result;
use ev3dev_rs::pupdevices::{GyroSensor, Motor, ColorSensor};
use ev3dev_rs::robotics::DriveBase;
use ev3dev_rs::parameters::{MotorPort, SensorPort, Direction};
#[tokio::main]
async fn main() -> Ev3Result<()> {
let left_motor = Motor::new(MotorPort::OutA, Direction::Clockwise)?;
let right_motor = Motor::new(MotorPort::OutD, Direction::Clockwise)?;
let gyro_sensor = GyroSensor::new(SensorPort::In1)?;
let color_sensor = ColorSensor::new(SensorPort::In4)?;
println!("Detected color: {}", color_sensor.color()?);
let drive = DriveBase::new(&left_motor, &right_motor, 62.4, 130.5)?.with_gyro(&gyro_sensor)?;
drive.use_gyro(true)?;
drive.straight(500).await?;
drive.turn(90).await?;
drive.curve(600, 90).await?;
drive.veer(600, 500).await?;
Ok(())
}
Hitechnic sensors, NXT sensors, and hub functions (Buttons, Leds, Screen, Sound) are not currently supported.
If you want support for a specific feature, please open an Issue.
Please see ev3dev-rs-template for detailed usage instructions.