Have been reading up on Pogramming, and starting to understand some basics.
I got a problem when i wanted to add more ports to this easy tutorial.
When i added the _BV(PD5), this was the only led blinking, not both. how do i configure this.
Do i need to define the pins separately ?
I have searched the net, but not any clear answers.
I used Programmers notepad.
Code:
#include <avr/interrupt.h>
#define F_CPU 100000UL
#include <util\delay.h>
int main()
{
DDRD = _BV(PD4); // this is the original
DDRD = _BV(PD5); // i added this
while(1) {
PORTD = _BV(PD4);
_delay_ms(1000);
PORTD &= ~_BV(PD4);
_delay_ms(1000);
PORTD = _BV(PD5); // The PD5 i added
_delay_ms(1000);
PORTD &= _BV(PD5);
_delay_ms(1000);
}
return (0);
}