ʵÏÖÏñgoogleÄÇÑù×Ô¶¯ÌáʾµÄÏÂÀ­¿ò

var?intIndex=0;arrList?=?new?Array();?
function?test()??
{?
?????
????dearray("1111,222,222a,aaa,aa1,bb,b222,b3,323313,3213,32213,dsfsdddd");?
????smanPromptList(arrList,"inputer1");?
????smanPromptList(arrList,"inputer2");?
????smanPromptList(arrList,"inputer3")?
}?
????
function?dearray(aa)//¶¨Òåarray?
{?
????arrList?=?aa.split(¡¯,¡¯);?
?????
}?
function?getAbsoluteWidth(ob)?
{?
????????return?ob.offsetWidth?
}?

function?smanPromptList(arrList,objInputId){?
????????var?objouter=document.getElementById("__smanDisp")?//ÏÔʾµÄDIV¶ÔÏó?
????????var?objInput?=?document.getElementById(objInputId);?//Îı¾¿ò¶ÔÏó?
????????var?selectedIndex=-1;?
????????var?intTmp;?//Ñ­»·ÓõÄ:)?
????????if?(objInput==null)?{alert(¡¯smanPromptList³õʼ»¯Ê§°Ü:ûÓÐÕÒµ½"¡¯+objInputId+¡¯"Îı¾¿ò¡¯);return?;}?
????????????//Îı¾¿òʧȥ½¹µã?
????????????objInput.οnblur=function(){?
????????????????objouter.style.display=¡¯none¡¯;?
????????????}?
????????????//Îı¾¿ò°´¼ü̧Æð?
????????????objInput.οnkeyup=checkKeyCode;?
????????????//Îı¾¿òµÃµ½½¹µã?
????????????objInput.οnfοcus=checkAndShow;?
????????????function?checkKeyCode(){?
????????????????var?ie?=?(document.all)??true:false?
????????????????if?(ie){?
????????????????????var?keyCode=event.keyCode?
????????????????????if?(keyCode==40||keyCode==38){?//ÏÂÉÏ?
????????????????????????var?isUp=false?
????????????????????????if(keyCode==40)?isUp=true?;?
????????????????????????chageSelection(isUp)?
????????????????????}else?if?(keyCode==13){//»Ø³µ?
????????????????????????outSelection(selectedIndex);}else{?
????????????????????????checkAndShow()?
????????????????????}?
????????????????}else{?
????????????????????checkAndShow()?
????????????????}?
????????????????divPosition()?
????????????}?
????????????function?checkAndShow(){?
????????????????????????var?strInput?=?objInput.value?
????????????????????????if?(strInput!=""){?
????????????????????????????divPosition();?
????????????????????????????selectedIndex=-1;?
????????????????????????????objouter.innerHTML?="";?
????????????????????????????for?(intTmp=0;intTmp<arrlist.length;inttmp++){?>
????????????????????????????????if?(arrList[intTmp].substr(0,?strInput.length)==strInput){?
????????????????????????????????????addOption(arrList[intTmp]);?
????????????????????????????????}?
????????????????????????????}?
????????????????????????????objouter.style.display=¡¯¡¯;?
????????????????????????}else{?
????????????????????????????objouter.style.display=¡¯none¡¯;?
????????????????????}function?addOption(value){?
????????????????????????objouter.innerHTML?+="<div?οnmοuseοver="this.classname=¡¯sman_selectedstyle¡¯"?οnmοuseοut="this.classname=¡¯¡¯"?οnmοusedοwn="document.getelementbyid(¡¯"+objinputid+"¡¯).value=¡¯"?+?value?+?"¡¯">"?+?value?+?"

"?????
????????????????????}?
????????????}?
????????????function?chageSelection(isUp){?
????????????????if?(objouter.style.display==¡¯none¡¯){?
????????????????????objouter.style.display=¡¯¡¯;?
????????????????}else{?
????????????????????if?(isUp)?
????????????????????????selectedIndex++?
????????????????????else?
????????????????????????selectedIndex--?
????????????????}?
????????????????var?maxIndex?=?objouter.children.length-1;?
????????????????if?(selectedIndex<0){selectedIndex=0}?
????????????????if?(selectedIndex>maxIndex)?{selectedIndex=maxIndex}?
????????????????for?(intTmp=0;intTmp<=maxIndex;intTmp++){?
????????????????????if?(intTmp==selectedIndex){?
????????????????????????objouter.children[intTmp].className="sman_selectedStyle";?
????????????????????}else{?
????????????????????????objouter.children[intTmp].className="";?
????????????????????}?
????????????????}?
????????????}?
????????????function?outSelection(Index){?
????????????????objInput.value?=?objouter.children[Index].innerText;

objouter.style.display=¡¯none¡¯;?
????????????}?
????????????function?divPosition(){?
????????????????var?clx,cly;?
????????????????clx=event.clientX;?
????????????????cly?=?event.clientY;?
????????????????objouter.style.top????=?cly+10;?
????????????????objouter.style.left????=?clx+20;??
????????????????objouter.style.width=?getAbsoluteWidth(objInput)?
????????????}?
????}?
????document.write("<div?id=¡¯__smandisp¡¯?style=¡¯;display:none;background:#e8f7eb;border:?1px?solid?#cccccc;font-size:14px;cursor:?default;¡¯?onbulr>?

");?
????document.write(" <style>.sman_selectedStyle{background-Color:#102681;color:#FFFFFF}</style> ");?
id="table1"?style="BORDER-COLLAPSE:?collapse"??></div?id=¡¯__smandisp¡¯?style=¡¯;display:none;background:#e8f7eb;border:?1px?solid?#cccccc;font-size:14px;cursor:?default;¡¯?onbulr>

int main(void) { const unsigned char *point; u16 i=0; delay_init(); //ÑÓʱº¯Êý³õʼ»¯ NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);//ÉèÖÃÖжÏÓÅÏȼ¶·Ö×éΪ×é2£º2λÇÀÕ¼ÓÅÏȼ¶£¬2λÏìÓ¦ÓÅÏȼ¶ // uart_init(115200); //´®¿Ú³õʼ»¯Îª115200 LED_Init(); //³õʼ»¯ÓëLEDÁ¬½ÓµÄÓ²¼þ½Ó¿Ú // KEY_Init(); //°´¼ü³õʼ»¯ AT24CXX_Init(); //IIC³õʼ»¯ OLED_init(); point= &picture_tab[0]; TIM_OCInitTypeDef TIM_OCInitStructure; delay_init(); //ÑÓʱº¯Êý³õʼ»¯ NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2); //ÉèÖÃNVICÖжϷÖ×é2:2λÇÀÕ¼ÓÅÏȼ¶£¬2λÏìÓ¦ÓÅÏȼ¶ uart_init(115200); //´®¿Ú³õʼ»¯Îª115200 LED_Init(); //LED¶Ë¿Ú³õʼ»¯ TIM3_Int_Init(4999,7199);//10KhzµÄ¼ÆÊýƵÂÊ£¬¼ÆÊýµ½5000Ϊ500ms TIM4_PWM_Init(10000-1,72-1); //72M/72=1MHz¼ÆÊýƵÂÊ,ÖØ×°ÔØÖµ while(1) { OLED_ShowString(0,30,"21221054",16); OLED_ShowString(0,15,"2023/5/18",16); OLED_ShowChinese(0,0,0,16,1); OLED_ShowChinese(16,0,1,16,1); OLED_ShowChinese(32,0,2,16,1); delay_ms(1000); OLED_Refresh_Gram(); //¸üÐÂÏÔʾµ½OLED if(++i > 3) { LED1=!LED1;//ÌáʾϵͳÕýÔÚÔËÐÐ i=0; } while(1) { u16 u16tmp; u16tmp += 500; if(u16tmp > 10000) u16tmp=0; //³õʼ»¯TIM4 Channe3 PWMģʽ TIM_OCInitStructure.TIM_OCMode = TIM_OCMode_PWM1; //Ñ¡Ôñ¶¨Ê±Æ÷ģʽ:TIMÂö³å¿í¶Èµ÷ÖÆģʽ2 TIM_OCInitStructure.TIM_OutputState = TIM_OutputState_Enable; //±È½ÏÊä³öʹÄÜ TIM_OCInitStructure.TIM_OCPolarity = TIM_OCPolarity_Low; //Êä³ö¼«ÐÔ:TIMÊä³ö±È½Ï¼«ÐÔ¸ß TIM_OCInitStructure.TIM_Pulse = u16tmp; TIM_OC3Init(TIM4, &TIM_OCInitStructure); //¸ù¾ÝTÖ¸¶¨µÄ²ÎÊý³õʼ»¯ÍâÉèTIM4 OC3 LED2=!LED2; //LED3=!LED3; delay_ms(300); } } }这段代码问题如下:declaration may not appear after executable statement inblock,TIM OCINITTYPEDEF TIM OCINITSTRUCTURE,请修改这个问题
06-09
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值