I'm not familiar with AVR programming, so what follows may be rubbish:-
I assume the LED is attached to PORTB bit 0.
1) that line seems to be just ensuring that bit 0 of register DDRB (data direction?) is set to 1 (output?).
2) the while loop seems to keep PORTB bit 0 at 1 and all the other bits at 0. How's that supposed to blink a LED?
You could if you knew that 0b00000001 was what you wanted. ORing preserves the direction of other bits. For example if DDRB was 0b00000100 ORing it with 0b00000001 gives 0b00000101.
Thanks. It means that it will ease out the process of preserving other bits. Like if we want the pin 2 to change to output, we can simply type 0b00000100 instead of repeating the direction of pin 0 again and again, i.e. 0b00000101
Thanks. It means that it will ease out the process of preserving other bits. Like if we want the pin 2 to change to output, we can simply type 0b00000100 instead of repeating the direction of pin 0 again and again, i.e. 0b00000101