Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
10 years, 5 months ago.
Doing an action for a specific time
I got a Problem. in my program I want to make a specific Action for 2 sec. but I cannot use the wait command since during the time, the code should continue in this time, but just make a specific type of code.
Can anyone help me? If it not good enough described, just tell me :) Greeings
2 Answers
10 years, 5 months ago.
Hello,I think these references may help you:
http://mbed.org/handbook/Ticker
http://mbed.org/handbook/Timeout
10 years, 5 months ago.
Your description of your problem is not good enough.
But if you want something to happen two seconds after running some code, a timeout interrupt function would be the way to go.
If you want to do something for two seconds, then I'm not exactly sure what you mean. If you want to run a loop for two seconds, use a timer and check if the timer is equal to or greater than 2 every time the loop runs.