Two LEDs are connected to ledPin1 and ledPin2 You need to co
Solution
void delay_loop(int n) //delay loop for n second
 {
 int c = 1, d = 1;
 
 for ( c = 1 ; c <= n*32767 ; c++ )
 for ( d = 1 ; d <= 32767 ; d++ ) //n second loop
 {
 }  
 }
void LED_ON()
 {
PORTC = 0x01 //TURNS LED ON
}
void LED_OFF()
 {
PORTC = 0x00 //TURNS LED OFF
}
int main()
 {
 DDRC = 0xFF; //MAKES PORTC OUTPUT PORT
while(1)
 {
 for ( c = 1 ; c <= 4*32767 ; c++ ) //this will run for 4 second (STEP 1 CODE)
 {
 for ( d = 1 ; d <= 32767 ; d++ )   
 {   
 LED_ON();
 delay_loop(0.5);           //Everthing inside this for loop will happen till 4 second
 LED_OFF();
 delay_loop(0.5);
 }
 }
for ( c = 1 ; c <= 4*32767 ; c++ ) //this will run for 4 second (STEP 2 CODE)
 {
 for ( d = 1 ; d <= 32767 ; d++ )   
 {
 LED_ON();
 delay_loop(0.25);            //Everthing inside this for loop will happen till 4 second
 LED_OFF();
 delay_loop(0.25);
 }
 }
Note: Please include necessary libraries respective to you microcontroller. This code is for AVR controller.

