I am currently programming an AVR butterfly dev board. I want to take input from the joystick and my program to do certain things whenever the joystick is puled down. To do this I have the following pieces of code. (There are more but this is what you need to answer the question.)
#define false 0
#define true 1
DDRB = (0<<DDB7);
PORTB = (1<<PB7);
....
while (PINB==1)
....
while (PINB==0)
....
Right now the program avt as PINB is never 0 neither is it 1. I think my problem is that I never even read if the joystick is moved down or not.