Ok you guys, here's where Im at.......



DEFINE OSC 20
DEFINE ADC_BITS 10
DEFINE ADC_CLOCK 3
DEFINE ADC_SAMPLEUS 10
TRISA = %11000001 'set portA
ADCON1 = %10000010 'read as analog
RAW VAR WORD 'Set ADC value to name of RAW
ADCIN 0, RAW 'READ ADC store value to RAW
millivolts VAR WORD
psitimes100 var word
millivolts = RAW */ 1250 'convert ADC to millivolts
psitimes100 = millivolts ** 47527 'convert millivolts to psi*100
psitimes100 = psitimes100 + 145 ' add sensor offset
TRISB = %11111111 'set portB all outputs

Main:

display3: psitimes100 = psitimes100 / 100 ' Find number of hundreds
psitimes100 = psitimes100 // 100 ' Remove hundreds from psitimes100
Gosub bin2seg ' Convert number to segments
Poke PortB, psitimes100 ' Send segments to LED
PortA.3 = 0
Pause 1 ' Leave it on 1 ms
PortA.3 = 1' Turn off digit to prevent ghosting
psitimes100 = psitimes100 / 10 ' Find number of tens
psitimes100 = psitimes100 // 10 ' Remove tens from psitimes100
Gosub bin2seg ' Convert number to segments
Poke PortB, psitimes100 ' Send segments to LED
PortA.4 = 0 ' Turn on second digit
Pause 1 ' Leave it on 1 ms
PortA.4 = 1
psitimes100 = psitimes100 ' Get number of ones
Gosub bin2seg ' Convert number to segments
Poke PortB, psitimes100 ' Send segments to LED
PortA.5 = 0' Turn on first digit
Pause 1 ' Leave it on 1 ms
PortA.5 = 1
Return ' Go back to caller

bin2seg: Lookup psitimes100, [0 = PortB %00111111, 1 = PortB %00000110, 2 = PortB %01011011, 3 = PortB %01001111, 4 = PortB %01100110, 5 = PortB %01101101, 6 = PortB %01111101, 7 = PortB %00000111, 8 = PortB %01111111, 9 = PortB %01101111], psitimes100
Return
Goto Main


Everything complies except for the lookup table which gives me an error...


error line 50, expected "]"

So apart from this, have I passed PicBasic programming 101 yet??? :-)

Thanks,

James.