Where you index your array here
Also high and low byte will just use first word of array.Code:for i=0 to 9 ADCON0.1 = 1 ' Start conversion While ADCON0.1=1:Wend ' Wait for conversion DataW.HighByte=ADRESH ' Read variable from ADC and save DataW.LowByte=ADRESL pause 50 next i
IF DATAW < 1023 THEN this also only reference first word of array.
Array must be used as in LCDOUT.
So your code should look like this
Code:TmpW var word DataW var word[10] i var byte main: for i=0 to 9 ADCON0.1 = 1 ' Start conversion While ADCON0.1=1:Wend ' Wait for conversion TmpW .HighByte=ADRESH ' Read variable from ADC and save TmpW .LowByte=ADRESL DataW[i]=TmpW pause 50 next i LCDOUT $fe,1 for i=0 to 9 lcdout dec dataw[i], " " next i





Bookmarks