AT89S52 Development Board (Mini) – Buzzer Interfacing
In AT89S52 Mini Development Board has an on board buzzer, connected to port pin P1.6 via jumper (J5). If the jumper is left open, then the corresponding port pin can be used independently. The sample code for testing the buzzer is given below. When the controller on the mini development board is programmed using this sample code, the buzzer produces a beep sound on each switch(SW1) press.SchematicSample Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
/************************************************************ HEADER FILES *************************************************************/ #include <REGX52.H> #define SW1 P2_0 #define beep P1_6 /************************************************************ MAIN FUNCTION *************************************************************/ void main() { while(1) { /* Check for switch press */ if(SW1==0) /* If SW1 is pressed, P2_0 gets low */ { beep=0; /* Turn on the buzzer */ while(SW1==0); /* Wait here till switch is released */ beep=1; /* Turn off the buzzer */ } } } /******************* END OF PROGRAM ***********************/ |
Topics related to AT89S52 Mini Development Board
- AT89S52 Mini Development Board – Overview
- AT89S52 Mini Development Board – LED Interfacing
- AT89S52 Mini Development Board – LCD Interfacing
- AT89S52 Mini Development Board – Serial communication
- AT89S52 Mini Development Board – EEPROM Interfacing
- AT89S52 Mini Development Board – Buzzer Interfacing
- AT89S52 Mini Development Board – Servo Motor Interfacing
- AT89S52 Mini Development Board – Switch Interfacing
- AT89S52 Mini Development Board – RFID Interfacing
Resources
How to buy?
- Click here to buy the rhydoLABZ AT89S52 Mni Development Board (Mini) V1.01
- Click here to buy the rhydoLABZ AT89S52 Development Board
- Click here to buy the rhydoLABZ AT89S52-24PU Microcontroller
- Click here to buy the rhydoLABZ ATMEL 89SXX ISP Programmer (RS232)
Support
Please share your ideas with us, visit our forum for discussion
Leave a Reply
You must be logged in to post a comment.