sanjeev309 / LinearBlink_atmega32

Linear blinking pattern on PORT D

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LinearBlink_atmega32

Linear blinking pattern on PORT D

Here the delay has been provided a static value.
To produce a incrementing or decrementing delay review the following code:

....
int del=100;
_delay_ms(del--); // WON'T WORK! => As of Atmel studi 4, the _delay_ms() function needs to be provided a constant;
....

INSTEAD USE:

void delay_ms(uint16_t delay){ // own function to pass a dynamic value of delay
while(delay--){
_delay_ms(delay);
}
}

About

Linear blinking pattern on PORT D


Languages

Language:C 100.0%