Last active
March 28, 2016 08:24
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->FIOSET = 0xffffffff; // Make all the Port pins as high | |
delay_ms(100); | |
LPC_GPIO2->FIOCLR = 0xffffffff; // 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