Hi,
I’m trying to get a couple of very simple examples to work with my EV3.
The following routine works, except when I change
motorWaitHandle = motorA.SpeedProfile(50, 200, 1600, 200,true);
to
motorWaitHandle = motorA.SpeedProfile(50, 200, 160, 200,true);
the WaitOne() call never then never returns.
public static void Main (string[] args)
{
Motor motorA = new Motor (MotorPort.OutA);
WaitHandle motorWaitHandle;
motorA.Off();
LcdConsole.WriteLine("Speed: " + motorA.GetSpeed() );
motorA.ResetTacho();
motorWaitHandle = motorA.SpeedProfile(50, 200, 1600, 200,true);
motorWaitHandle.WaitOne();
LcdConsole.WriteLine("Done moving motor");
LcdConsole.WriteLine("Position A: " + motorA.GetTachoCount());
Thread.Sleep(500);
motorA.ResetTacho();
motorWaitHandle = motorA.SpeedProfile(-50, 200, 160, 200,true);
motorWaitHandle.WaitOne();
LcdConsole.WriteLine("Done moving both motors");
motorA.Off();
}
(Taken from MotorSamples)
Do I need to build delays into my code?
Thanks,
Dawid
Follow