在程序設(shè)計(jì)中,如果需要重復(fù)執(zhí)行一段代碼,就需要使用循環(huán)結(jié)構(gòu)。接下來我們將介紹在LabVIEW中常常使用的2種循環(huán)結(jié)構(gòu)While 循環(huán)和For 循環(huán)。
標(biāo)簽: LabVIEW 循環(huán)結(jié)構(gòu)
上傳時(shí)間: 2013-10-19
上傳用戶:遠(yuǎn)遠(yuǎn)ssad
溫濕度傳感器 sht11 仿真程序 sbit out =P3^0; //加熱口 //sbit input =P1^1;//檢測(cè)口 //sbit speek =P2^0;//報(bào)警 sbit clo =P3^7;//時(shí)鐘 sbit ST =P3^5;//開始 sbit EOC =P3^6;//成功信號(hào) sbit gwei =P3^4;//個(gè)位 sbit swei =P3^3;//十位 sbit bwei =P3^2;//百位 sbit qwei =P3^1;//千位 sbit speak =P0^0;//報(bào)警音 sbit bjled =P0^1;//報(bào)警燈 sbit zcled =P0^2;//正常LED int count; uchar xianzhi;//取轉(zhuǎn)換結(jié)果 uchar seth;//高時(shí)間 uchar setl;//低時(shí)間 uchar seth_mi;//高時(shí)間 uchar setl_mi;//低時(shí)間 bit hlbz;//高低標(biāo)志 bit clbz; bit spbz; ///定時(shí)中斷程序/// void t0 (void) interrupt 1 using 0 { TH0=(65536-200)/256;//5ms*200=1000ms=1s TL0=(65536-200)%256; clo=!clo;//產(chǎn)生時(shí)鐘 if(count>5000) { if(hlbz) { if(seth_mi==0){seth_mi=seth;hlbz=0;out=0;} else seth_mi--; } if(!hlbz) { if(setl_mi==0){setl_mi=setl;hlbz=1;out=1;} else setl_mi--; } count=0; } else count++; } ///////////// ///////延時(shí)/////// delay(int i) { while(--i); } ///////顯示處理/////// xianshi() { int abcd=0; int i; for (i=0;i<5;i++) { abcd=xianzhi; gwei=1; swei=1; bwei=1; qwei=1; P1=dispcode[abcd/1000]; qwei=0; delay(70); qwei=1; abcd=abcd%1000; P1=dispcode[abcd/100]; bwei=0; delay(70); bwei=1; abcd=abcd%100; P1=dispcode[abcd/10]; swei=0; delay(70); swei=1; abcd=abcd%10; P1=dispcode[abcd]; gwei=0; delay(70); gwei=1; } } doing() { if(xianzhi>100) {bjled=0;speak=1;zcled=1;} else {bjled=1;speak=0;zcled=0;} } void main(void) { seth=60;//h60秒 setl=90;//l90秒 seth_mi=60;//h60秒 setl_mi=90;//l90秒 TMOD=0X01;//定時(shí)0 16位工作模式 TH0=(65536-200)/256; TL0=(65536-200)%256; TR0=1; //開始計(jì)時(shí) ET0=1; //開定時(shí)0中斷 EA=1; //開全中斷 while(1) { ST=0; _nop_(); ST=1; _nop_(); ST=0; // EOC=0; xianshi(); while(!EOC) { xianshi(); } xianzhi=P2; xianshi(); doing(); } }
上傳時(shí)間: 2013-10-16
上傳用戶:黃蛋的蛋黃
我近期計(jì)劃陸續(xù)整理出以下幾個(gè)方面的學(xué)習(xí)筆記:初學(xué) ModelSimSE 時(shí)被迷糊了幾天的若干概念;在 ModelSimSE 中添加 ALTERA 仿真庫的詳細(xì)步驟;用 ModelSimSE 進(jìn)行功能仿真和時(shí)序仿真的方法(ALTERA 篇);ModelSimSE 中常用到的幾個(gè)命令及 DO文件的學(xué)習(xí)筆記;近來學(xué)到的幾招 TestBench 的技巧
上傳時(shí)間: 2013-10-13
上傳用戶:18602424091
This Unix C code monitors a web server every few minutes by trying to retrieve its home page. It sends you email when it can t connect, and every so often while the server is still down. It sends a final message when it comes back up. If you have email paging, just direct the email to your pager address.
標(biāo)簽: monitors retrieve minutes server
上傳時(shí)間: 2015-01-11
上傳用戶:pompey
The TapiComm sample uses both the Telephony API and the Win32 Communications API to demonstrate one way to implement a very simple TTY application. While the user interface and TTY emulation are very rudimentary, the TAPI and comm modules are fairly complete.
標(biāo)簽: Communications demonstrate API Telephony
上傳時(shí)間: 2014-12-07
上傳用戶:chenxichenyue
eGroupWare is a multi-user, web-based groupware suite developed on a custom set of PHP-based APIs. Currently available modules include: email, addressbook, calendar, infolog (notes, to-do s, phone calls), content management, forum, bookmarks, wiki
標(biāo)簽: eGroupWare multi-user developed PHP-based
上傳時(shí)間: 2015-02-20
上傳用戶:hphh
最新的支持向量機(jī)工具箱,有了它會(huì)很方便 1. Find time to write a proper list of things to do! 2. Documentation. 3. Support Vector Regression. 4. Automated model selection. REFERENCES ========== [1] V.N. Vapnik, "The Nature of Statistical Learning Theory", Springer-Verlag, New York, ISBN 0-387-94559-8, 1995. [2] J. C. Platt, "Fast training of support vector machines using sequential minimal optimization", in Advances in Kernel Methods - Support Vector Learning, (Eds) B. Scholkopf, C. Burges, and A. J. Smola, MIT Press, Cambridge, Massachusetts, chapter 12, pp 185-208, 1999. [3] T. Joachims, "Estimating the Generalization Performance of a SVM Efficiently", LS-8 Report 25, Universitat Dortmund, Fachbereich Informatik, 1999.
上傳時(shí)間: 2013-12-16
上傳用戶:亞亞娟娟123
由于時(shí)間緊迫及事先準(zhǔn)備不足,編譯器最后定型時(shí)暴露出不少問題及不足之處,主要有以下一些方面: 不支持?jǐn)?shù)組數(shù)據(jù)類型,這是文法分析器設(shè)計(jì)時(shí)的一個(gè)疏漏,由于時(shí)間關(guān)系,最后只得把掃描器中已做好的相關(guān)的數(shù)組部分刪去。 對(duì)于float數(shù)據(jù)類型的支持,直到語義分析都是正常的,也能生成相應(yīng)的匯編代碼,但由于我們對(duì)8086/8088指令系統(tǒng)本身了解不足,這樣的匯編代碼將只能做到含義上完全忠實(shí)于源程序,但不能運(yùn)行。 對(duì)于局部變量的支持,則于時(shí)間緊迫,所有的局部變量全被處理成靜態(tài)變量。使遞歸函數(shù)不能得到正確的結(jié)果。 對(duì)于函數(shù)調(diào)用語句,不進(jìn)行參數(shù)匹配檢查,如果參數(shù)數(shù)量不對(duì),也將能通過編譯,但運(yùn)行時(shí)將產(chǎn)生非法操作。 對(duì)&& !等邏輯操作在最后生成代碼時(shí)處理比較粗燥,生成的代碼在邏輯復(fù)雜時(shí)將不能保證運(yùn)行正常。 接下來有一些,不能說是缺陷,但必須說明的問題: 對(duì)于main函數(shù),沒有參數(shù)表,通回類型也必須為void,但如果寫上參數(shù)表及其他返回類型也能編譯通過,生成代碼時(shí)將簡(jiǎn)單地忽略,不影響最后的代碼的運(yùn)行。 對(duì)于while,for,if語句,其語句體不管是一句還是多句,必須都有{}圍起來。這跟C語言中若是一句則可省略{}不同。
標(biāo)簽:
上傳時(shí)間: 2015-03-14
上傳用戶:gmh1314
access the database using Flash MX. Please remember that Flash is unable to natively access a database. A programming language (ASP in this case) provides the programming logic, while Flash works at the presentation tier of the application.
標(biāo)簽: access Flash database remember
上傳時(shí)間: 2014-01-04
上傳用戶:小碼農(nóng)lz
先序遍歷非遞歸算法 #define maxsize 100 typedef struct { Bitree Elem[maxsize] int top }SqStack void PreOrderUnrec(Bitree t) { SqStack s StackInit(s) p=t while (p!=null !StackEmpty(s
標(biāo)簽: maxsize PreOrderUn SqStack typedef
上傳時(shí)間: 2014-01-26
上傳用戶:hewenzhi
蟲蟲下載站版權(quán)所有 京ICP備2021023401號(hào)-1