According to a video tutorial I saw somewhere, here's the code for a blinking LED:
Why do we have to say
in the beginning of the int function?
Does this mean that during the program, DDRB can accept values of either 0b00000000 or 0b00000001? Is DDRB set to 0b00000000 by default?
Code:
#include <avr/io.h>
#include <util/delay.h>
int main(void)
{
DDRB = DDRB | 0b00000001;
while(1)
{
PORTB = 0b00000000;
_delay_ms(100);
PORTB = 0b00000001;
_delay_ms(100);
}
}
Why do we have to say
Code:
DDRB = DDRB | 0b00000001;
Does this mean that during the program, DDRB can accept values of either 0b00000000 or 0b00000001? Is DDRB set to 0b00000000 by default?
Last edited: