1extern crate ev3dev_lang_rust;
2
3use ev3dev_lang_rust::motors::{LargeMotor, MediumMotor, MotorPort, TachoMotor};
4use ev3dev_lang_rust::Ev3Result;
5
6fn main() -> Ev3Result<()> {
7 let large_motor = LargeMotor::get(MotorPort::OutA)?;
8 let medium_motor = MediumMotor::get(MotorPort::OutB)?;
9
10 large_motor.set_speed_sp(300)?;
12 medium_motor.set_speed_sp(300)?;
13
14 large_motor.run_to_rel_pos(Some(360))?;
15 medium_motor.run_to_rel_pos(Some(180))?;
16
17 #[cfg(target_os = "linux")]
18 large_motor.wait_until_not_moving(None);
19
20 let tacho_motor_1 = TachoMotor::get(MotorPort::OutA)?;
23 let tacho_motor_2 = TachoMotor::get(MotorPort::OutB)?;
24
25 tacho_motor_1.run_to_rel_pos(Some(360))?;
26 tacho_motor_2.run_to_rel_pos(Some(180))?;
27
28 #[cfg(target_os = "linux")]
29 tacho_motor_1.wait_until_not_moving(None);
30
31 Ok(())
32}