Code: Select all
void main(){
DDRB.b0=0; // input BUTTON
Portb.b0=1; // set Pull-up
DDRB.b1 = 1; // output LED
while(1){
if(portb.b0==0) portb.b1 = 1; // if button has pressed turn on led
}}
I tried up side code but it is not working.
Can somebody tell me somethings about DDRX, PORTX, PINX ?
Thanks Gray.