Created
March 30, 2016 04:04
-
-
Save SaheblalBagwan/fb344d26c0022cb00b8946efbd8223d4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <lpc17xx.h> | |
void delay_ms(unsigned int ms) | |
{ | |
unsigned int i,j; | |
for(i=0;i<ms;i++) | |
for(j=0;j<20000;j++); | |
} | |
/* start the main program */ | |
int main() | |
{ | |
SystemInit(); //Clock and PLL configuration | |
LPC_PINCON->PINSEL4 = 0x000000; //Configure the PORT2 Pins as GPIO; | |
LPC_GPIO2->FIODIR = 0xffffffff; //Configure the PORT2 pins as OUTPUT; | |
while(1) | |
{ | |
LPC_GPIO2->FIOPIN = 0xffffffff; // Make all the Port pins as high | |
delay_ms(100); | |
LPC_GPIO2->FIOPIN = 0x00; // Make all the Port pins as low | |
delay_ms(100); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment