Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Top Posters

Who's Online (0)

Powered by Vanilla. Made with Bootstrap.
Here is the code for convergence and divergence of 8 LED with pic
  • Hey guys here is the code for convergence and divergence of 8 LED with pic18f4580 micro controller..


    #include<p18cxxx.h>
    void delay(void);
    unsigned char var1,var2,i;
    void main()
    {
    TRISD=0x00;
    while(1)
    {
    var1=0x01;
    var2=0x80;
    for(i=0;i<=7;i++)
    {
    LATD=var1|var2;
    var1=var1<<1;
    var2=var2>>1;
    delay();
    }
    }
    }
    void delay(void)
    {
    int j;
    for(j=0;j<=4;j++)
    {
    ;
    }
    }


    NOTE: Delay used here is not a standard time delay..