+ Post New Thread
Results 1 to 5 of 5
  1. #1
    Junior Member level 1
    Points: 395, Level: 4

    Join Date
    Nov 2015
    Posts
    16
    Helped
    0 / 0
    Points
    395
    Level
    4

    8x10 LED MATRIX VERTICAL SCANNING WORKING BUT HOW TO CONTROL SPEED ?

    Anybody know how to control speed ?
    It is very fast.

    Code C - [expand]
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    
    #include<pic.h>
    #include <delay4.c>
     
    #define _XTAL_FREQ 20e6
    __CONFIG(0x3F3A);
     
    char z,i;                          
    void pattern(char a,char b,char c,char d,char e,char f,char g,char h,char n)
       {
         for(z=0;z<9;z++)   
           {
        for(i=0;i<10;i++)  
              {
              PORTD=a;DelayMs(100);RB6=1;RB6=0;
              PORTD=b;DelayMs(100);RB6=1;RB6=0;
              PORTD=c;DelayMs(100);RB6=1;RB6=0;
              PORTD=d;DelayMs(100);RB6=1;RB6=0;
              PORTD=e;DelayMs(100);RB6=1;RB6=0;
              PORTD=f;DelayMs(100);RB6=1;RB6=0;
              PORTD=g;DelayMs(100);RB6=1;RB6=0;
              PORTD=h;DelayMs(100);RB6=1;RB6=0;
              PORTD=n;DelayMs(100);RB6=1;RB6=0;
              }
          (a=a<<1);
          (b=b<<1);
          (c=c<<1);
          (d=d<<1);
          (e=e<<1);
          (f=f<<1);
          (g=g<<1);
          (h=h<<1);
          (n=n<<1);
          }
       }
     
    /////////////////////////////////////////
    void main()
    {   
        TRISA=0x00;
        TRISD=0x00;
        TRISB=0x00;
        TRISC=0x00;
        TRISE=0x00;
     
        PORTD = 0x00;
        PORTB = 0x00;
        PORTC = 0x00;
        PORTE = 0x00;
        RB7=1;
        RB7=0;
        while(1)
         {
         pattern(0xFF, 0x80, 0x80, 0x80, 0xFF, 0x01, 0x01, 0x01, 0xFF); //LETTER S
        }
    }
    Last edited by andre_teprom; 16th November 2015 at 13:33. Reason: added syntax formatting / fixed identing

    •   Alt16th November 2015, 13:34

      advertising

        
       

  2. #2
    Super Moderator
    Points: 26,044, Level: 39
    andre_teprom's Avatar
    Join Date
    Nov 2006
    Location
    Brazil
    Posts
    7,853
    Helped
    971 / 971
    Points
    26,044
    Level
    39
    Blog Entries
    5

    Re: 8x10 LED MATRIX VERTICAL SCANNING WORKING BUT HOW TO CONTROL SPEED ?

    The intuitive question:
    Why not insert dalay at the loop function on the main() ?
    --------------------------------------------------------------------------------------------------
    Part of the world that you live in, You are the part that you're giving ( Renaissance )



    •   Alt16th November 2015, 13:45

      advertising

        
       

  3. #3
    Junior Member level 1
    Points: 395, Level: 4

    Join Date
    Nov 2015
    Posts
    16
    Helped
    0 / 0
    Points
    395
    Level
    4

    Re: 8x10 LED MATRIX VERTICAL SCANNING WORKING BUT HOW TO CONTROL SPEED ?

    main loop i am using delay but display dot dot dot go ......



    •   Alt16th November 2015, 13:54

      advertising

        
       

  4. #4
    Super Moderator
    Points: 26,044, Level: 39
    andre_teprom's Avatar
    Join Date
    Nov 2006
    Location
    Brazil
    Posts
    7,853
    Helped
    971 / 971
    Points
    26,044
    Level
    39
    Blog Entries
    5

    Re: 8x10 LED MATRIX VERTICAL SCANNING WORKING BUT HOW TO CONTROL SPEED ?

    Not clear, you need depict few more elaborated the the problem.
    --------------------------------------------------------------------------------------------------
    Part of the world that you live in, You are the part that you're giving ( Renaissance )



  5. #5
    Junior Member level 1
    Points: 395, Level: 4

    Join Date
    Nov 2015
    Posts
    16
    Helped
    0 / 0
    Points
    395
    Level
    4

    Re: 8x10 LED MATRIX VERTICAL SCANNING WORKING BUT HOW TO CONTROL SPEED ?

    i am using pic16f877a controller mplab hitech c compiler .this program was working fast and i am using for(s=0;still<100;s++)loop for main function .the scanning row is same speed dot dot dot one by one its go.this program taken by net.

    Code C - [expand]
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    
    #include <htc.h>
    #define _XTAL_FREQ 4e6 // 4MHz 
    __CONFIG(0x3FFA);
    void delay(unsigned int k)
    {for(int i=0;i<=k;i++)}
    void pattern(unsigned int a,b,c,d,e,f,g,h,i,j)
    { 
    for(int z=0;z<9;z++)
    {   for(int z=0;z<10;z++)
    {
    PORTB=a;delay(100);RA0=1;RA0=0;
    PORTB=b;delay(100);RA0=1;RA0=0;
    PORTB=c;delay(100);RA0=1;RA0=0;
    PORTB=d;delay(100);RA0=1;RA0=0;
    PORTB=e;delay(100);RA0=1;RA0=0;
    PORTB=f;delay(100);RA0=1;RA0=0;
    PORTB=g;delay(100);RA0=1;RA0=0;
    PORTB=h;delay(100);RA0=1;RA0=0;
    PORTB=i;delay(100);RA0=1;RA0=0;
    PORTB=j;delay(100);RA0=1;RA0=0;
    }
    (a=a<<1);
    (b=b<<1);
    (c=c<<1);
    (d=d<<1);
    (e=e<<1);
    (f=f<<1);
    (g=g<<1);
    (h=h<<1);
    (i=i<<1);
    (j=j<<1);
     
    }
    }
    void main()
    {
    TRISB=0;TRISA=11100;PORTA=0;PORTA=2;PORTA=1;PORTA= 0;
    while(1)
    {
    pattern(28,20,54,34,99,127,127,99,65,65); //LETTER A
    pattern(124,102,99,99,126,126,99,99,102,124); //LETTER B
    pattern(62,127,99,96,96,96,96,99,127,62); //LETTER C
    pattern(124,126,103,99,99,99,99,103,126,124); //LETTER D
    pattern(127,127,96,96,124,124,96,96,127,127); //LETTER E
     
    }
     
    }
    some alter to use this program .i want 10x8 matrix vertical scrolling and left to right scrolling hitech c compiler program
    Last edited by andre_teprom; 16th November 2015 at 14:19. Reason: added syntax formatting



--[[ ]]--