PDA

View Full Version : How to reference variable bits in a loop



JackPollack
- 21st April 2006, 15:03
I have a variable IRdata=%1010
I want to be able to reference the individual bits of IRdata through a loop.

I know that I can use Irdata.Bit1 (bit2, etc)
I also Know that I can use IRdata & %0001

I can't figure out how to reference the bits through a loop though
eg:
for n=1 to 4
IRbit=Irdata.Bitn
Next n


Thanks

Melanie
- 21st April 2006, 15:42
Please do a SEARCH on the forum...

http://www.picbasic.co.uk/forum/showthread.php?t=544

rhino
- 21st April 2006, 15:43
Does this help?
Melanie's explaination (http://www.picbasic.co.uk/forum/showthread.php?t=544)

-edit- Looks like she beat me to the punch

JackPollack
- 21st April 2006, 15:56
Thanks

:-)