dolphinlabs
...
Doplhin labs
News

LPC2148-Buzzer Interfacing



Warning: readfile(Buzzer.htm) [function.readfile]: failed to open stream: No such file or directory in /home/dolphinlabs/public_html/Word-SubMenu-Display.php on line 104

1.      Buzzer

Objective:

Write a program to ON buzzer.

Hardware Connections for LPC2148 Board:-

1.      Plug in the USB cable to your computer and to the Board. Once the USB cable is plugged in, Board is powered up.

2.      Connect +5V of buzzer interface block to +5V supply pin on the board.

3.      Connect BUZZER pin of buzzer interface block to P1.16 pin of microcontroller.

Diagram:

+5V

 

Source code:

 #include "LPC214x.H"                        /* LPC21xx definitions */

#include "type.h"

#define Buzzer            (1 << 16)

void delay(int count)

{

  int j=0,i=0;

 

  for(j=0;j<count;j++)

  {

    /* At 60Mhz, the below loop introduces

    delay of 10 us */

    for(i=0;i<35;i++);

  }

}

 

int main(void)

{

            SCS     = 0;

 

    IODIR1 |= Buzzer;

           

            while(1)            

            {

            IOSET1 = Buzzer;                  /* turn ON Buzzer */

                        delay(90000);

                IOCLR1 = Buzzer;             /* turn OFF Buzzer */                        

                        delay(90000);

            }

}

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


Get SOCIAL







SAFE & SECURE SHOPPING

visa card master card maestro card
Maverick IT Industries Pvt. Ltd.