thannara123
Advanced Member level 4
- Joined
- Jan 7, 2010
- Messages
- 1,488
- Helped
- 0
- Reputation
- 242
- Reaction score
- 111
- Trophy points
- 1,353
- Location
- God's Own country India, Kerala
- Activity points
- 9,684
I have a program to ON and OFF a device , the following program [MPLab Pic16f877a controller Simulation on Proteus)
string("Press to ON ");
__delay_ms(500);
while(PORTDbits.RD7==0);
while(PORTDbits.RD7==1)
{
PORTDbits.RD7==0; // flush again the press
// working code
}
First it will operate normally ,and the second iteration the while loop excuted without pressing my RD7 switch .
what is the reason ?
string("Press to ON ");
__delay_ms(500);
while(PORTDbits.RD7==0);
while(PORTDbits.RD7==1)
{
PORTDbits.RD7==0; // flush again the press
// working code
}
First it will operate normally ,and the second iteration the while loop excuted without pressing my RD7 switch .
what is the reason ?