PIC Mikro c - bit testing

Status
Not open for further replies.

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' ?
 

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.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…