单片机:如何将音乐程序与行车灯程序结合,使音乐同时闪烁?

这是一个音乐程序:# include # defineuintnsignident # defineucharunsigniedCharsbitvoice = p 1 6;ucharcodesound[]={0xff,0x17,0x02,0x17,0x03,0x18,0x03,0x19,0x02,0x15,0x03,0x16,0x03,0x17,0x03ucharzdjs=0,jp;del(yj);void main(void){ uintdpjs = 0;ucharyjTMOD=0x01,IE = 0x82TH0=0xd8,TL0 = 0xefTR0 = 1;while(1){ zdjs = 0;dpjs++;yj = sound[dpjs];dpjs++;jp = sound[dpjs];而(zdjs!=jp){if(yj!=0xff){if(yj!=0){voice=!语音;del(yj);} else { dpjs = 0;打破;} }否则{ voice = 0;德尔(jp);} } } } time 0()interrupt 1 using 1 { TH0 = 0x D8,TL0 = 0xefzdjs++;} del(yj){ ucharyj 2 = 2;而(yj!=0){while(yj2!= 0){ yj2-;} yj2 = 2;yj-;}}这是一个运行灯程序:#include//51系列单片机定义文件# defineuchuransignedchar//定义无符号字符#defineuintunsignedint//定义无符号整数void delay(uint);//声明延迟函数void main(void){ ui nti;uchartempwhile(1){ temp = 0x 01;for(I = 0;我& lt8;I++)//8个运行灯一一闪烁{ P2 = ~ temp;延迟(50);//调用延迟函数temp