Help understanding a couple of lines. adc0831
spinefan03
Posts: 10
Hello all,
I recently manipulated the adc0831_DEMO to function correctly using the adc TLC5489. Everything is working correctly, I just have two lines that I am not sure of the purpose. Changing these values give me unexpected results (obviously, if I had no idea what to expect in the first place)
Could someone give me a clue as to why everything seems to be functioning flawlessly?
data := 0 ' This will accumulate the resulting value
data <<= 1 ' Multiply data by two
Thank you for any help.
Ryan
I recently manipulated the adc0831_DEMO to function correctly using the adc TLC5489. Everything is working correctly, I just have two lines that I am not sure of the purpose. Changing these values give me unexpected results (obviously, if I had no idea what to expect in the first place)
Could someone give me a clue as to why everything seems to be functioning flawlessly?
data := 0 ' This will accumulate the resulting value
data <<= 1 ' Multiply data by two
Thank you for any help.
Ryan
Comments
The first line is clearing the accumulator.
The second line is shifting the bits in data to the left -- I'm assuming the data is arriving MSB first; the shift moves previous bits and makes room in bit0 for the new one.