PDA

View Full Version : Byte from variable



Lilleljung
- 14th February 2015, 14:01
Hi everybody.
I do have a small issue..
I try to extract a bit from a byte, but it wont work. Can anyone explain how to do, and what im doing wrong.
I have searched the forum and google, but just cant find a answer.


Codesnippet:

tmp=%01011111

For I=0 to 7

sr_data=tmp.I ' It doesnt work with I here, I have to use a real number like 0-7

sr_clock=1
sr_clock=0

next I

Acetronics2
- 14th February 2015, 15:58
tmp=%01011111

For I=0 to 7

sr_data=tmp.0[I] ' It should work with I here,
sr_clock=1
sr_clock=0

next I


manual $ 7.6.5 ...

Lilleljung
- 14th February 2015, 22:29
Perfect. Its work, and I also read the chapter in the manual. Couldnt find it before. So I know WHY it works.
Thanks a lot, now I can continue on my project.