Hi Bill12780,
Take a look at this post and see if it helps.
Bits, Bytes Words and Arrays - Melanie
http://www.picbasic.co.uk/forum/showthread.php?t=544
-Adam-
Hi Bill12780,
Take a look at this post and see if it helps.
Bits, Bytes Words and Arrays - Melanie
http://www.picbasic.co.uk/forum/showthread.php?t=544
-Adam-
I think this is what you are looking for. In the manual under "Ports and other Registers".
$0f = 00001111Code:anyvar = PORTB & $0f 'Isolate lower 4 bits of PORTB and place result into anyvar
$00ff = 11111111
Now you can check "anyvar" for changes.
Dave
Always wear safety glasses while programming.
Thanks everyone...
These are some really good idea's. I had to "walk away" for awhile. I will read Melanie's post(man she is a wealth of knowledge....Bet she was born with a PBP manual in her hand!), try a few things. and get back with you all tonight.
Thanks for the tips.
Bill12780
This will work;
PortB.0 <-- zero after PortB indicates you're dealing with a bit.Code:X VAR BYTE main: for X = 0 to 7 if PortB.0[X] = 1 then xxxxx next X goto main
PortB.0[X] <-- [X] = the bit index pointer.
"PortB.0 <-- zero after PortB indicates you're dealing with a bit.
PortB.0[X] <-- [X] = the bit index pointer."
Thanks bruce that is a brilliant little tidbit of information (for a noob like me)that I probly glazed over in the manual 20 times and it never stuck..
Thanks! I knew it could be done like that...Just not smart enought to figure out how! hahha
thanks again!
Bill12780
Last edited by bill12780; - 23rd July 2007 at 21:43.
Bookmarks