PDA

View Full Version : Unable to pass a variable to LCDOUT without getting compile errors



Ferroto Baggins
- 28th February 2010, 16:00
I'm having trouble getting LCDOUT to accept a variable. Currently if I type in actual text it'll work fine and display, on the other hand if I feed it a variable it'll refuse to compile.


'************************************************* ***************
'* Name : UNTITLED.BAS *
'* Author : [select VIEW...EDITOR OPTIONS] *
'* Notice : Copyright (c) 2009 [select VIEW...EDITOR OPTIONS] *
'* : All Rights Reserved *
'* Date : 12/22/2009 *
'* Version : 1.0 *
'* Notes : *
'* : *
'************************************************* ***************
define OSC 20

DEFINE LCD_DREG PORTC
DEFINE LCD_DBIT 8
DEFINE LCD_RSREG PORTA
DEFINE LCD_RSBIT 4
DEFINE LCD_EREG PORTB
DEFINE LCD_EBIT 5
DEFINE LCD_RWREG PORTB
DEFINE LCD_RWBIT 4
var h as int
var m as int
var s as int
ADCON1 = %00000000
ADCON0 = %00000001

h = 0
m = 0
s = 0
Lcdprint:
lcdout $FE, $80, h 'this is where I get compile errors.
lcdout $FE, $80, ":"
lcdout $FE, $80, m 'this is where I get compile errors.
lcdout $FE, $80, ":"
lcdout $FE, $80, s 'this is where I get compile errors.
pause 1000
s = s + 1
if (s = 60)
then
m = m + 1
s = 0
end if

if (m = 60)
then
h = h + 1
m = 0
end if

if (h = 25)
then
h = 0
end if
goto Lcdprint

Byte_Butcher
- 28th February 2010, 16:23
Your variable declarations are unfamiliar to me...



var h as int
var m as int
var s as int

Try:



h var byte
m var byte
s var byte





steve

Ferroto Baggins
- 28th February 2010, 16:43
OK it works now :)