Oct 30, 2012 #1 D DTSFA Newbie level 5 Joined Oct 30, 2012 Messages 10 Helped 0 Reputation 0 Reaction score 0 Trophy points 1,281 Activity points 1,344 hi I am new to using Mikro C for PICs, is it possible to bit test port for a '0', or is it case of bit testing port for '1', true, and if not, then must be '0' ?
hi I am new to using Mikro C for PICs, is it possible to bit test port for a '0', or is it case of bit testing port for '1', true, and if not, then must be '0' ?
Oct 31, 2012 #2 Tahmid Advanced Member level 6 Joined Jun 17, 2008 Messages 4,756 Helped 1,798 Reputation 3,588 Reaction score 1,656 Trophy points 1,413 Location Berkeley, California Activity points 30,586 It's obviously possible to bit test for 0. Let's say you want to test PORTA0. So, you could do it like this: Code: if (PORTA.B0 == 0){ //........... } or Code: if (RA0_bit == 0){ //........... } Hope this helps. Tahmid.
It's obviously possible to bit test for 0. Let's say you want to test PORTA0. So, you could do it like this: Code: if (PORTA.B0 == 0){ //........... } or Code: if (RA0_bit == 0){ //........... } Hope this helps. Tahmid.