Program code
#include <LPC214x.h>
#include <stdio.h>
#define BUZZ 7
void Delay(void);
void Wait(void);
void Delay()
{
unsigned int i,j;
for(i=0;i<1000;i++)
for(j=0;j<700;j++);
}
void main()
{
PINSEL0 = 0x00; //Configure Port0.7 as GPIO
IODIR0 = 3 << BUZZ; //Configure Port0.7 as OutPut pin
while(1)
{
IOSET0 = 1 << BUZZ;
Delay();
IOCLR0 = 1 << BUZZ;
Delay();
}
}
Circuit Diagram
No comments:
Post a Comment