Quantcast
Channel: MEL PICBASIC Forum
Viewing all articles
Browse latest Browse all 4793

Again about array

$
0
0
Hi !
I tried to read 10 samples of ADC values and sending to LCD display.
Code:

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
        DataW.HighByte=ADRESH                ' Read variable from ADC and save
        DataW.LowByte=ADRESL
        pause 50
next i

IF DATAW < 1023  THEN
      LCDOUT $fe,1
      for i=0 to 9
      lcdout dec dataw[i], " "
      next i
      endfor   
PAUSE 1000                         
Endif


Goto main

But on LCD I have the value of ADC and seven "0". (like : 77 0 0 0 0 0 0 0)
Please, help ! What I do wrong ?
Thanks !

Viewing all articles
Browse latest Browse all 4793

Trending Articles