Skip to content

Open-source Rust runtime for VEX robots.

vexide provides a safe and efficient runtime and toolchain for writing VEX V5 programs in the Rust Programming Language. 🦀

main.rs
struct Robot {
	motor: Motor,
}

impl CompetitionRobot for Robot {
	async fn opcontrol(&mut self) -> Result {
		self.motor.set_voltage(10.0)?;
		
		Ok(())
	}
}

#[vexide::main]
async fn main(peripherals: Peripherals) {
	let my_robot = Robot {
		motor: Motor::new(peripherals.port_1, Gearset::Green, Direction::Forward)?,
	};

	Competition::new(my_robot).await;
}