8. LED Blink

Back To All Submissions
Previous Submission
Next Submission

Solving Approach

How do you plan to solve it?

 
 

 

 

Code

/*Paste your code here*/
#define LED_PIN   PORTB0   // Example: LED connected to PORTB0

void delay_ms(unsigned int ms); // Assume delay function available

void main(void) {
    // Configure LED pin as output
    DDRB |= (1 << LED_PIN);

    while (1) {
        // LED ON
        PORTB |= (1 << LED_PIN);
        delay_ms(400);

        // LED OFF
        PORTB &= ~(1 << LED_PIN);
        delay_ms(800);
    }
}

 

 

 

Output

Video

Add video of the output (know more)


Photo of Output
Add a photo of your hardware showing the output.
 

 

 

Was this helpful?
Upvote
Downvote