nzkunal
Member level 2
push button avr
I am having some problem using a push button with an AT90S8535.
Basically the PB is connected to supply negative (GND) and the other end to an input pin PORTB.2. PORT B direction is input and initial value 1 (High)
When I prees the PB my code doesn;t seem to respond. I have checked the hardware connection i.e PORTB.2 does actually go to GND when PB is pressed, cant figure out why code doesn't respond. Is checking if PORTB.2 = 0 or 1 the right way to do it can anybody suggest some simple test code.
I am having some problem using a push button with an AT90S8535.
Basically the PB is connected to supply negative (GND) and the other end to an input pin PORTB.2. PORT B direction is input and initial value 1 (High)
When I prees the PB my code doesn;t seem to respond. I have checked the hardware connection i.e PORTB.2 does actually go to GND when PB is pressed, cant figure out why code doesn't respond. Is checking if PORTB.2 = 0 or 1 the right way to do it can anybody suggest some simple test code.