Friday, September 16, 2022

How to interface Buzzer with LPC2148

 



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

GPS sensor interface with ESP8266 using Blynk IoT cloud

   Circuit diagram: Source Code: #include <TinyGPS++.h> #include <SoftwareSerial.h> #define BLYNK_PRINT Serial #include <ESP8...