Re: type conversion Problem

I don't understand why you don't just create a function void delay(ms)? Conventionally you only use #defines for things such as your first line of code. Your other 2 defines would be frowned upon.

I would modify your code to be the following:

#define F_MCU 16            /* Takt-Frequenz in MHz */


void delay_short()
{
    _delay_loop_2(8);
}


void delay(ms)            
{
    for (unsigned int i = ms; i > 0; --i)
             _delay_loop_2(250*F_MCU); 
}