anschau
Newbie level 4
I am using Atmega8 for an led project. i wold like to use a button to tell the program to change between different light patterns with the leds. i think what i need to do is something like this
void main (){
DDRD = 0x00;
PORTD = 0xff;
while (1){
/* code for light pattern
if (PIND == 1){
return (1);
}else return (0);
}
}
can some one tell me what im doing wrong in this code or suggest a simpler easy to understand code.
void main (){
DDRD = 0x00;
PORTD = 0xff;
while (1){
/* code for light pattern
if (PIND == 1){
return (1);
}else return (0);
}
}
can some one tell me what im doing wrong in this code or suggest a simpler easy to understand code.