07-27-2018 10:51 PM
digital input,digital outputを使用してモーターを3秒動かす、5秒停止、再び3秒動かして完全停止の順に制御したいのですが上手く出来ません。どのようにすれば成功するのか、御教授願います。(ピン番号は自由)
I want to control in the order of digital input, digital output to move the motor for 3 seconds, stop for 5 seconds, move again for 3 seconds and then stop completely, but it can not be successful. Please teach how you can succeed.(Pin number is free)
07-28-2018 06:27 AM
07-28-2018 07:58 PM - edited 07-28-2018 08:14 PM
Though it was possible to move it for 3 seconds by stopping for 3 seconds and stopping it for 5 seconds, it is impossible to finish the standby state (permanent stop as long as there is no external input) at the end. How do I do it?
07-28-2018 08:23 PM
You're confusing Delay and Elapsed Time?
The first is what you want. It'll hold the application for a period of time.
The second will check to see if the time has elapsed and then move on. It takes practically no time and won't hold your application. It's meant to be used to check if a duration has passed so you don't hold up your application. Ideally, you'd loop back to check rather than trying to run a single loop and make your UI appear to hang while waiting.
You'll also want to see if you have watchdogs in your hardware. Those may require a more frequent send of the motor value. If you don't do that, it may stop moving because you're not feeding the watchdog.