51 single chip microcomputer (AT89C52) controls buzzer

Publisher:玉树琼花Latest update time:2018-06-21 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

#include  

#define uchar unsigned char  

#define uint unsigned int  

sbit beep=P0^0;  

void delay(uint z)  

{  

    uint x,y;  

    for(x=z;x>0;x--)  

        for(y=111;y>0;y--);  

}  

void main()  

{  

    while(1)  

    {  

        beep=0;  

        delay(500);  

        beep=1;  

        delay(500);  

    }  

}  

Reference address:51 single chip microcomputer (AT89C52) controls buzzer

Previous article:51 MCU (AT89C52) matrix keyboard detection program
Next article:51 microcontroller (AT89C52) external interrupt program

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号