kam1787
Advanced Member level 3

Code:#define _XTAL_FREQ 8000000
I am sure you would agree that hard-coding a parameter that is open for change is not a great idea.
Isn't there a better way?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Code:#define _XTAL_FREQ 8000000
I am sure you would agree that hard-coding a parameter that is open for change is not a great idea.
#define _XTAL_FREQ 8000000
_delay_ms();
void delay_ms ( int delay )
{
int ms, i;
for ( ms = 0; ms < delay; ms ++ )
for ( i = 0; i < 5; i ++ );
}
Isn't there a better way?
void delay_ms ( int delay )
{
int ms, i;
for ( ms = 0; ms < delay; ms ++ )
for ( i = 0; i < 5; i ++ );
}
No, I do not agree.
This is NOT a hardcoded delay:
Code:#define _XTAL_FREQ 8000000