Thursday, 9 June 2016

Interfacing of Led with ARM CORTEX


Led (  Light emitting diode) : Light Emitting Diodes are the mostly commonly used components in many applications. They are made of semiconducting material. This article describes about basic interfacing of LEDs to the 8051 family microcontrollers.


Interfacing of led with LPC2148:


Circuit diagram for blinking a led:




Program for blinking a led:



#include "NUC1xx.h"
#include "GPIO.h"
#include "SYS.h"
int main()
{
DrvGPIO_Open(E_GPC,12,E_IO_OUTPUT);   
    DrvGPIO_Open(E_GPC,13,E_IO_OUTPUT);   
while(1)
{
    DrvGPIO_ClrBit(E_GPC,12);
    DrvSYS_Delay(300000);
    DrvGPIO_SetBit(E_GPC,12);
    DrvSYS_Delay(300000);
    DrvGPIO_ClrBit(E_GPC,13);
    DrvSYS_Delay(300000);
    DrvGPIO_SetBit(E_GPC,13);
    DrvSYS_Delay(300000);
}
   
}

0 comments:

Post a Comment

if you have any doubt please let me know