Unable to pass a variable to LCDOUT without getting compile errors


Closed Thread
Results 1 to 3 of 3
  1. #1

    Default Unable to pass a variable to LCDOUT without getting compile errors

    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.

    Code:
    '****************************************************************
    '*  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

  2. #2
    Join Date
    Jan 2009
    Location
    California, USA
    Posts
    323


    Did you find this post helpful? Yes | No

    Default

    Your variable declarations are unfamiliar to me...

    Code:
    var h as int
    var m as int
    var s as int
    Try:

    Code:
    h   var   byte
    m   var   byte
    s   var   byte



    steve

  3. #3


    Did you find this post helpful? Yes | No

    Default

    OK it works now

Similar Threads

  1. Timer + rc5
    By naga in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 19th November 2009, 08:56
  2. need help in coding..
    By daphne8888 in forum mel PIC BASIC
    Replies: 1
    Last Post: - 19th March 2008, 08:31
  3. Help GPS read with serin
    By leinske in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 5th September 2007, 03:33
  4. Crystalfontz LCD
    By jman12 in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 9th February 2007, 16:04
  5. having problems with Hantronix 20x4 lcd
    By Rhatidbwoy in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 22nd December 2005, 13:22

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts