Confused On Dig & Lookup


Results 1 to 3 of 3

Threaded View

  1. #2
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    I guess, there is a variable named "A", but now shown in your code here.

    So in the second FOR LOOP, there should be "N = A Dig B".

    But, even then, I did not understand what you meant by individual digits? individual digits of which variable? Can you be more specific and give example?


    Also, I have some modifications and suggestions as below. I removed some parts to make it work faster and seem easier to understand.

    Code:
    A VAR BYTE 'this was not listed!
    E VAR BYTE
    F VAR BYTE
    N VAR BYTE
    D VAR BYTE
    S VAR BYTE
    B VAR BYTE
    T VAR BYTE
    
    
    
    Loop1: '8 Digits To Display T & A
    
    
    For E = 0 To 3
    
            Pause F 'display T =1234
    
            Lookup T DIG E,[$41,$f3,$49,$61,$33,$25,$05,$f1,$01,$31], PORTB '0-9
    
            Lookup E,[$ef,$df,$bf,$7f], PORTC 'set Digit
    
            Pause F
    
            PORTC = $ff
    
        Next E
    
    
        For B = 0 To 3
            Pause F 'display A =5678
    
            Lookup A DIG B,[$41,$f3,$49,$61,$33,$25,$05,$f1,$01,$31],PORTB
    
            Lookup B,[$f7,$fb,$fd,$fe],PORTC
    
            Pause F
    
            PORTC = $ff
    
        Next B
    
    Pause F
    
    Goto Loop1 ' Display Forever


    Edit: 'Also, if you store these numbers in EEPROM, then you can just use the following.
    ' could work even faster, and use less code space.

    'Example: READ T DIG E, PORTB


    ------------------------
    Last edited by sayzer; - 5th December 2006 at 17:55.
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

Similar Threads

  1. NMEA CheckSum Routine
    By Tom Gonser in forum Code Examples
    Replies: 2
    Last Post: - 6th June 2015, 22:24
  2. PIC16f877 code crosses boundary @800h
    By inventosrl in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 6th April 2009, 22:03
  3. DIG DEC Madness
    By earltyso in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 13th June 2008, 23:05
  4. Rc int on 16f874
    By hakan in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 15th July 2007, 18:57
  5. problem with USART
    By leemin in forum Serial
    Replies: 4
    Last Post: - 11th December 2006, 17:56

Members who have read this thread : 0

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