8x8 Scrolling LED display (Simple example)


Results 1 to 40 of 69

Threaded View

  1. #22
    Join Date
    Mar 2009
    Posts
    48


    Did you find this post helpful? Yes | No

    Default Re: 8x8 Scrolling LED display (Simple example)

    of course this is helpful here is the code that i changed, i know there is a beter way to feed variable but this is for testing and is the siplest way...thx for helping and insiration


    and link for video.

    Code:
     
    '*************************************************  ***************
    ' SIMPLE 14X8 LED MATRIX SCROLLING EXAMPLE
    ' LED Matrix columns are conected to PORTC pin rc0 via ULN2003 and CD4017.
    ' RC1 reset for 4017
    ' LED Matrix rows conected to PORTB via 100 ohm resistors (Resistor value dependant on LEDs used)
    ' RB0 - top row
    ' MCLR (pin1) connected via 4K7 to +5v supply.
    '
    ' today
    '*************************************************  **************************************
    Device 16F877A
    Xtal 8
    TRISB = %00000000
    TRISC = %00000000
    PORTB=0
    PORTC=0
        kolona        var    Byte
        brojac        var    Byte
        scan                 var Byte
        scroll                 var    Byte
        leddata        VAR Byte[47]
    START:    
    Clear
     
            leddata[0] = $FF    
        leddata[1] = $91 
        leddata[2] =$91
        leddata[3] =$90
        leddata[4] = $01
        leddata[5] = $01    
        leddata[6] = $ff 
        leddata[7] =$01
        leddata[8] =$01
        leddata[9] = $46
        leddata[10] = $89    
        leddata[11] = $99 
        leddata[12] =$b1
        leddata[13] =$62
            leddata[14] = $00      'start smjalija
            leddata[15] = $00
            leddata[16] = $00
        leddata[17] = $7e 
        leddata[18] =$81
        leddata[19] =$95
        leddata[20] = $a1
        leddata[21] = $a1    
        leddata[22] = $95 
        leddata[23] =$81
        leddata[24] =$7e
            leddata[25] =$00
        leddata[26] =$00
            leddata[27] = $00 
            leddata[28] = $00
     
     
     LOOP: 
     For scroll = 0 To 1 ' NUMBER OF LETERS or changes display TO SHOW
     
             For scan = 0 To 185
     
             PORTC.1 = 1                       'reseting 4017
             PORTC.1 =0    
                For kolona = 0 To 13
                    PORTC.0 = 1  'clock 4017
                    PORTC.0 =0
                    PORTB = leddata[kolona]
                    DelayUS 250
                    PORTB=0         
                Next
             Next
             For brojac = 0 To 14
            leddata[brojac]=leddata[brojac+14]
            Next
            Next
    GoSub scrolling  
    GoTo START
    End    
    scrolling:
        leddata[0] = $00
        leddata[1] = $00
        leddata[2] = $00
        leddata[3] = $00
        leddata[4] = $00
            leddata[5] = $00
        leddata[6] = $00
        leddata[7] = $00
        leddata[8] = $00
        leddata[9] = $00
            leddata[10] = $00
        leddata[11] = $00
        leddata[12] = $00
        leddata[13] = $00
        leddata[14] = $00
            leddata[15] = $00
        leddata[16] = $00
        leddata[17] = $00
            leddata[18] = $FF    'start of 'E'
        leddata[19] = $91 
        leddata[20] =$91
        leddata[21] =$81
        leddata[22] = $81
        leddata[23] = $00
        leddata[24] = $01    'start of 'T'
        leddata[25] = $01 
        leddata[26] =$ff
        leddata[27] =$01
        leddata[28] = $01
        leddata[29] = $46    'start of 'S'
        leddata[30] = $89 
        leddata[31] =$99
        leddata[32] =$b1
        leddata[33] = $62
        leddata[34] = $00    'start of '!'
        leddata[35] = $00 
        leddata[36] =$df
        leddata[37] =$00
        leddata[38] =$00
           For scroll = 0 To 38 ' NUMBER OF LETERS TO SHOW
     
     
             For scan = 0 To 25
                      PORTC.1 = 1  'reseting 4017
             PORTC.1 =0    
                For kolona = 0 To 14
                    PORTC.0 = 1 'clock 4017
                    PORTC.0 =0
                    PORTB = leddata[kolona]
                    DelayUS 300
                    PORTB=0         
                Next
             Next
             For brojac = 0 To 37
            leddata[brojac]=leddata[brojac+1]
            Next
            Next 
    Return
    Last edited by ScaleRobotics; - 7th February 2011 at 23:47. Reason: changed to video tags for video

Similar Threads

  1. Conway's Game Of Life
    By wellyboot in forum mel PIC BASIC Pro
    Replies: 45
    Last Post: - 28th May 2020, 06:14
  2. MY FIRST scrolling 8X8 LED
    By earltyso in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 15th August 2008, 16:23
  3. 5x7 LED Matrix Scrolling Display
    By roycarlson in forum mel PIC BASIC Pro
    Replies: 18
    Last Post: - 4th August 2008, 23:50
  4. Replies: 2
    Last Post: - 14th July 2008, 22:11
  5. LCD will not start
    By btaylor in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 24th May 2007, 02:30

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