全文预览

机电接口技术课程设计报告

上传者:读书之乐 |  格式:doc  |  页数:12 |  大小:258KB

文档介绍
Р if(++Time_Count != 100) return;Р Time_Count=0;Р Operation_Type = 4;Р break;?Р case 4:Р if(++Time_Count != 8) return;Р Time_Count=0;Р YELLOW_B=!YELLOW_B;Р GREEN_B=1;Р if(++Flash_Count !=10) Р return;Р Flash_Count=0;Р Operation_Type = 1;Р break;?Р?}Р}Рuchar code SONG_TONE[]=Р{Р 212,212,190,212,159,169,212,212,190,212,142,159,212,212,106,126,129,169,190,119,119,126,159,142,159,0Р};Рuchar code SONG_LONG[]=Р{Р 9,3,12,12,12,24,9,3,12,12,12,24,9,3,12,12,12,12,12,9,3,12,12,12,24,0Р};Рvoid DelayMS(uint ms)Р{Р uchar t;Р?while(ms--)Р?{Р for(t=0;t<240;t++);Р?}Р}Рvoid PlayMusic()Р{Р uint i =0,j,k;Р?while(SONG_LONG[i]!=0||SONG_TONE[i]!=0)Р?{Р for(j=0;j<SONG_LONG[i]*20;j++)Р {Р BEEP = ~BEEP;Р for(k=0;k<SONG_TONE[i]/3;k++);Р }Р DelayMS(10);Р i++;Р?}Р}Рvoid main()Р{Р while(1)Р?{Р TMOD = 0x01;Р IE = 0x82;

收藏

分享

举报
下载此文档