Home→Forums→MonoBrick EV3 Firmware→Problems with SpeedProfile and WaitHandles
- This topic has 5 replies, 2 voices, and was last updated 10 years, 10 months ago by
Anders Søborg.
-
AuthorPosts
-
January 4, 2015 at 07:00 #5178

Dawid MostertParticipantHi,
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,
DawidJanuary 4, 2015 at 22:05 #5179
Anders SøborgKeymasterHi there
This problem has already been reported and fixed. However it has not been officially released. But you can download a precompiled DLL of the master branch from my ftp server. An officially will be created once I get the time to do some more testing (which should be some time this coming week).
/Anders
January 5, 2015 at 06:24 #5180
Dawid MostertParticipantThanks Anders!
Works like a charm.
Where is the best place to look for reported problems? This forum or GitHub?
Dawid
January 5, 2015 at 06:43 #5181
Dawid MostertParticipantSorry Anders,
Seems I Spoke too soon 🙁
Still not working in all instances…
This does not work:
var handle = motor.SpeedProfile(50, 100, 700, 100, true);Regards,
DawidJanuary 5, 2015 at 20:07 #5182
Anders SøborgKeymasterHi there
I will look into this…. in the meantime simply ignore the waitone on the waithandle like shown below.
motorWaitHandle = motorA.SpeedProfile(-50, 100, 700, 100,true); //motorWaitHandle.WaitOne(); System.Threading.Thread.Sleep(1000); motorA.Brake();/Anders
January 7, 2015 at 20:08 #5195
Anders SøborgKeymaster -
AuthorPosts
You must be logged in to reply to this topic.

Follow