PDA

View Full Version : Please explain PORTB.0[i]



blainecf
- 1st July 2006, 23:04
In the PBP Pro manual, under REPEAT..UNTIL there is some sample code:

-------------

i = 0
REPEAT
PORTB.0[i] = 0
i = i + 1
UNTIL i > 7

-------------

Could someone explain the concept of [i] in this context? I understand PORTB; I understand the low bit of PORTB referred to as PORTB.0; but then I get confused.

Thanks for your patience!

Pic_User
- 1st July 2006, 23:42
Take a look at these great forum posts from Melanie and Bruce.

Melanie
Bits, Bytes Words and Arrays
http://www.picbasic.co.uk/forum/showthread.php?t=544

Bruce
Indexing Port Pins
http://www.picbasic.co.uk/forum/showthread.php?p=19943

Hope this is what you wanted.

-Adam-

blainecf
- 2nd July 2006, 01:31
I've printed both of them out, and I'll read over them during the weekend. This also may answer another question I posted.

As always, thanks to this community for the help!

bcf