MARWEN007
Junior Member level 2
- Joined
- Apr 16, 2011
- Messages
- 24
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,481
Hi to all I want to achieve a small C program with 16F84A like so:
when I press a botton one LED lights
and when I release the botton switches This led turn off??!
* take a0 and b0 is an entry is there anyone out there who help me pouver
I make a small code but the LED remains lit after Still pressing botton
when I press a botton one LED lights
and when I release the botton switches This led turn off??!
* take a0 and b0 is an entry is there anyone out there who help me pouver
I make a small code but the LED remains lit after Still pressing botton
Code:
void main() {
debut:
TRISB = 0x00;
PORTB = 0;
TRISA = 0xff;
PORTA = 0;
while (1){
if(portA.f0==0)
{ portB.f0=0;}
else if (portA.f0==1)
{ portB.f0=1;}
else {goto debut;}
}
}