Writ e a Embedded C code for Led blinking ARM Processor.

Writ e a Embedded C code for Led blinking ARM Processor.

/*  LED INTERFACE*/

#include<nxp/iolpc2148.H>

void delay()
{
 for(int i=0x00;i<=0xff;i++)
 for(int j=0x00;j<=0xFf;j++);

}

/*-----------------------------------------------------------------------------*/
// LED INTERFACE LINES
// LED0   -   LED7 :  P1.24 - P1.31
//------------------------------------------------------------------------------

void main()
{

      PINSEL2 = 0X00000000;       // P1.24 TO P1.31 as GPIO
      IO1DIR  = 0XFF000000;       // p1.24 TO P1.31 Configured as
    Output port.

   while(1)
   {
     IO1SET=0XFF000000;           // P1.24 TO P1.31 goes to high
    state
     delay();
     IO1CLR=0XFF000000;           // P1.24 TO P1.31 goes to low
     state
     delay();
   }
}
/*  LED INTERFACE*/

#include<nxp/iolpc2148.H>

void delay()
{
 for(int i=0x00;i<=0xff;i++)
 for(int j=0x00;j<=0xFf;j++);

}


void main()
{

      PINSEL2 = 0X00000000;       // P1.24 TO P1.31 as GPIO
      IO1DIR  = 0XFF000000;       // p1.24 TO P1.31 Configured as Output port.

   while(1)
   {
     IO1SET=0XFF000000;           // P1.24 TO P1.31 goes to high state
     delay();
     IO1CLR=0XFF000000;           // P1.24 TO P1.31 goes to low state
     delay();
   }

}
Share on Google Plus

About CONSPEAR TECH

0 comments:

Post a Comment