Sign In

Led Light Running Display 40*8

shyammech shyammech71.sm@gmail.com India

Hardware: Pic16f887 With 4mhz Software: C Project With MPLAB

i cant able to find the perfect code for running function..

Images

led light running display  40*8

Program

#include<pic.h>
#define _XTAL_FREQ 4000000
void delay(int a)
{
    while(a--);
}
char a2[8]={0x18,0x3c,0x66,0xc3,0xff,0xff,0xc3,0xc3};
char a1[8]={0x09,0x15,0x05,0x0f,0x15,0x15,0x08,0x00};
char k[8]={0xEE,0xED,0xEB,0xE7,0xEB,0xED,0xEE,0x00};
char k1[8];
char a[8]={0xFB,0xF5,0xEE,0xEE,0xE0,0xEE,0xEE,0x00};
char v[8]={0xEE,0xEE,0xEE,0xF5,0xF5,0xFB,0xFB,0x00};
char ii[8]={0xF1,0xFB,0xFB,0xFB,0xFB,0xFB,0xF1,0x00};
void main()
{
    TRISD=0x00;
    TRISB=0x00;
    PORTB=0x00;
    PORTD=0x00;
    ANSEL=0x00;
    ANSELH=0x00;
    while(1)
    {
        for (int j=0;j<8;j++)
        {
        PORTB=j;
         RD1=0;
        for (int i=7;i>=0;i--)
        {
          // k[j]=~k[j];
            RD0=(a2[j]>>i)&1;
            RD2=1;
          //_delay(100);
            RD2=0;
          //_delay(100);
        }
        RD1=1;
      
        _delay(2500);
        }
        for(int j=0;j<8;j++)
        {
        PORTB=j;
         RD3=0;
        
                 for (int i=7;i>=0;i--)
       {
           
            RD0=(a2[j]>>i)&1;
            RD2=1;
         // _delay(100);
            RD2=0;
          //_delay(100);
        }
        RD3=1;
      
        _delay(1000);
        }for (int j=0;j<8;j++)
        {
        PORTB=j;
         RD4=0;
        
                 for (int i=7;i>=0;i--)
        {
           
            RD0=(a2[j]>>i)&1;
            RD2=1;
           //_delay(100);
            RD2=0;
          // _delay(100);
        }
        RD4=1;
      
        _delay(1000);
        }for (int j=0;j<8;j++)
        {
        PORTB=j;
         RD5=0;
        
                 for (int i=7;i>=0;i--)
       {
           
            RD0=(a2[j]>>i)&1;
            RD2=1;
           //_delay(100);
            RD2=0;
           //_delay(100);
        }
        RD5=1;
      
        _delay(1000);
        }
    
}
}

Post a reply to shyammech

Think you can help shyammech ? Then post your thoughts that might help shyammech. You will earn a lot of reputation in the technical community.

If your program is in multiple files, then ZIP the entire folder and attach below

Images and Screenshots

These helps other better understand your suggestion.