Other Parts Discussed in Thread: CONTROLSUITE
Tool/software: Code Composer Studio
Hi,
How can make or call a delay function in seconds? Is there a library for sleep_time in code composer I can call?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software: Code Composer Studio
Hi,
How can make or call a delay function in seconds? Is there a library for sleep_time in code composer I can call?
Karzan,
You can either use predefined delay functions available in .h file such as: delay_ms() or delay_us() (so for one second delay you can use delay_ms(1000) or delay_us(1000000)) or make your delay function and call it wherever in your code:
void delay_loop(void);
/
/
/
/
void delay_loop()
{
short i;
for (i = 0; i < DELAY; i++) {}
}
Then you need to define the value of "DELAY" based on the desired delay time and the clock speed of your CPU.
--Kash
If my post answers your question, please click on"Verified Answer" button.