I don't expect anything, the scheme I gave is for pointing out the problem as simple as possible. Problem is even if I don't push BTN1 it executes the contents of if loop there. On Mon, Oct 24, 2011 at 8:25 PM, Geo wrote: > Yigit Turgut wrote: >> the code is as following already, forgot to add sorry; >> >> sbit BTN1 at RB1_bit; >> sbit PROT at RB2_bit; >> sbit =A0TEST at RB3_bit; >> >> void main() { >> >> TRISB =3D =A000001110; >> PORTB =3D 00001010; >> PROT =3D 0; >> >> while(1){ >> if( BTN1 =3D=3D =A00){ >> PROT =3D ~PROT } =A0} >> > What do you expect to happen when BTN1 goes back to =3D=3D1 ? > > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .