for bits to bytes
nick bernard
Posts: 329
hail
is there a way that i can reference the bits in a byte as if the byte were an array of 8 bits?
it would mucho simplify my code
thx
nick
is there a way that i can reference the bits in a byte as if the byte were an array of 8 bits?
it would mucho simplify my code
thx
nick
Comments
dog1 var dog.bit(0)
dog2 var dog.bit(1)
and so on
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sid Weaver
USB-powered Stamp Board
http://hometown.aol.com/newzed/index.html
·
dog·· VAR··Byte
dog1· VAR· dog.Bit0
dog2· VAR· dog.Bit1
If you want to check a bit on-the-fly, you can index it like this:
· check = dog.LOWBIT(idx)
... where idx·would be·0 to 7 if dog is a Byte.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office
i was fairly certain that there was a way to do it but i just didnt have the syntax
nick
See the section called "Memory and Variables."
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office