anschau
Newbie level 4
- Joined
- Jun 14, 2011
- Messages
- 7
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,333
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.