BrianPeek / legoev3

LEGO MINDSTORMS EV3 API for .NET
Apache License 2.0
137 stars 72 forks source link

Wait for motor to finish #24

Open njsokalski opened 7 years ago

njsokalski commented 7 years ago

I want to send a command (to turn a motor) and then wait for the motor to finish before doing anything else. Is there any way to:

  1. Raise an event when a motor stops. I know that the BrickChanged event is raised when a motor turns, but what I need is kind of the reverse of that, I need to know when a motor stops turning (sort of like a BrickNotChanged event) OR
  2. Detect whether a motor is turning (either a property of method) Without a way to be notified when a motor finishes, I'm not sure how to determine when I should start turning the next motor. Is there any way to do either of these things, or do you have any suggestions as to determine when to start the next motor (I don't have enough sensors to use that to determine when the motor finishes)? Thanks.
BrianPeek commented 7 years ago

If memory serves, the OutputReady command is designed for this. It will toggle when the motor starts and stops.

njsokalski commented 7 years ago

Where is the OutputReady command? I did not see one by that name.

Nathan Sokalski njsokalski@hotmail.commailto:njsokalski@hotmail.com http://www.nathansokalski.com/


From: Brian Peek notifications@github.com Sent: Tuesday, February 28, 2017 2:06 PM To: BrianPeek/legoev3 Cc: njsokalski; Author Subject: Re: [BrianPeek/legoev3] Wait for motor to finish (#24)

If memory serves, the OutputReady command is designed for this. It will toggle when the motor starts and stops.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/BrianPeek/legoev3/issues/24#issuecomment-283132293, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AGA_R409W2ufV9MIYprkJUgkmxC8rPMGks5rhHAZgaJpZM4MOq5V.

BrianPeek commented 7 years ago

I believe it only exists in source, you'd have to pull down the project and build yourself...I haven't had the time to dedicate to keeping this maintained with release packages, unfortunately. :(

njsokalski commented 7 years ago

Is there anywhere that I can get instructions on how to do that? I have never really used anything from GitHub where I need to build and install the code directly (I have only done stuff where it is installed as a package or some other automated fashion). I don't mind if I need to do it directly, but I don't want to do something wrong that messes up my current configuration. Thanks.

Nathan Sokalski njsokalski@hotmail.commailto:njsokalski@hotmail.com http://www.nathansokalski.com/


From: Brian Peek notifications@github.com Sent: Tuesday, February 28, 2017 2:53 PM To: BrianPeek/legoev3 Cc: njsokalski; Author Subject: Re: [BrianPeek/legoev3] Wait for motor to finish (#24)

I believe it only exists in source, you'd have to pull down the project and build yourself...I haven't had the time to dedicate to keeping this maintained with release packages, unfortunately. :(

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/BrianPeek/legoev3/issues/24#issuecomment-283144126, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AGA_RxNm4FhzKK5eD_PxCQ7U-AKYTt35ks5rhHsugaJpZM4MOq5V.