Reply by Erich Styger June 28, 20052005-06-28
If you are using such a busy loop like the one below: make sure that you
write it in assembly/inline assembly so you control the exact time.
For the case below you may want to declare 'i' as volatile: the compiler may
optimize it away as the loop is not doing anything.

A more elegant solution would be to set up a timer.

Erich
Reply by nrmlguru June 28, 20052005-06-28
Hey one way of giving delay is put a for loop.

Ex: int i;
for(i=0;i<2000;i++);

Again this depends upon what processor speed u are using.
To verify you can go to Debugger provided by Code warrior. i.e Green
ICON in your IDE.

In debugger window select Simulator\clock frequency.
Here u can set the desired cpu frequency. After setting the freq set
a break points at before for loop and instruction after for loopthen
execute. At the below u will get the time taken to execute the for
loop. This is crude method of getting a delay.....

If you want accurate delay then configure one of timers in output
compare mode and go ahead.

I think this solves your problem
Reply by eng_ahmed_m_abdelgayed June 28, 20052005-06-28
I use codewarrior 3.1 and i want to know how to make delay on
controller with C.
and another question please how to use trigonometric functions
including the required header files.

thanks in advance!