完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
|
|
相关推荐
1个回答
|
|
回帖奖励 +15 分积分
#include
#define uchar unsigned char #define uint unsigned int ***it BEEP = P3^7; ***it K1 = P1^4; ***it K2 = P1^5; ***it K3 = P1^6; ***it K4 = P1^7; void DelayMS(uint x) { uchar t; while(x--) { for(t=0;t<120;t++); } } void Play(uchar t) { uchar i; for(i=0;i<100;i++) { BEEP = ~BEEP; DelayMS(t); } BEEP = 0; } void main() { P1 = 0xff; while(1) { if(K1==0) Play(1); if(K2==0) Play(2); if(K3==0) Play(3); if(K4==0) Play(4); } } 自己加几个开关加油 |
|
|
|
评论功能暂时关闭~
小黑屋| 手机版| Archiver| 电子发烧友 ( 粤ICP备14022951号 )
GMT+8, 2023-7-4 21:23 , Processed in 0.653753 second(s), Total 80, Slave 62 queries .
Powered by 电子发烧友网
© 2015 www.ws-dc.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 深圳华秋电子有限公司
电子发烧友 (电路图) 粤公网安备 44030402000349 号 电信与信息服务业务经营许可证:粤 B2-20160233 工商网监 粤ICP备 14022951 号