String problem or data type problem ?
I need to know what data type this needs to be to correctly display. I am basicaly taking a temp reading and displaying it on my 2x20 lcd screen. The last line of code is were i get the compile error....
I get a compile error because i am not addressing the data type or something?
Help please
Thanks
{{ Demo LCD Uses LCDDEMO Version 1.2 Uses ADC0831 with Lm34 as a temp }} CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 esc = $1B 'Escape code cr = $0D 'Carriage Return code lf = $0A 'Line Feed code eos = $FF 'End of string code eog = $FF 'End of graphics code space = $20 'Space character code var byte lm34temp, temp OBJ LCD : "LCDDEMO" pub main repeat dira :=0 'set pin 5 as input lm34temp :=0 'starts the lm34temp variable as 0 temp:=ina 'sets the value of temp to the value of pin 5 (one or zero) dira[noparse][[/noparse]7]~~ 'sets pin as output outa[noparse][[/noparse]7]~~ 'sets pin 7 high outa[noparse][[/noparse]7]~ 'sets pin 7 low 'takes chip select low activating the adc 'the ADC0831 repeat 8 dira[noparse][[/noparse]6]~~ 'sets pin as output outa[noparse][[/noparse]6]:=1 'sets clock (pin 6) high outa[noparse][[/noparse]6]:=0 'sets clock (pin 6)low 'takes the adc clk low if ina==1 temp:=1 else temp:=0 lm34temp:=lm34temp*2 lm34temp:=lm34temp+temp waitcnt (1_000_000 * 50 + cnt ) LCD.init 'Initialize the display LCD.writestr(@LineIt1) 'Display repeat 'Just sit and run dat LineIt1 byte "Holder = ",lm34temp,$DF," C",cr,eos <----------------------------Here Lm34temp ? ? ?
I get a compile error because i am not addressing the data type or something?
Help please
Thanks
Comments
What do you want to tell him??
when you say BYTE in DAT please only add constant byte values as 0, 255, -1, "A" or "ABC", the last is a simplification for "A", "B", "C".
You can also use CONS names of course, but not "lm34temp". That is not a constant!