在程序設計中,如果需要重復執行一段代碼,就需要使用循環結構。接下來我們將介紹在LabVIEW中常常使用的2種循環結構While 循環和For 循環。
上傳時間: 2013-10-19
上傳用戶:遠遠ssad
溫濕度傳感器 sht11 仿真程序 sbit out =P3^0; //加熱口 //sbit input =P1^1;//檢測口 //sbit speek =P2^0;//報警 sbit clo =P3^7;//時鐘 sbit ST =P3^5;//開始 sbit EOC =P3^6;//成功信號 sbit gwei =P3^4;//個位 sbit swei =P3^3;//十位 sbit bwei =P3^2;//百位 sbit qwei =P3^1;//千位 sbit speak =P0^0;//報警音 sbit bjled =P0^1;//報警燈 sbit zcled =P0^2;//正常LED int count; uchar xianzhi;//取轉換結果 uchar seth;//高時間 uchar setl;//低時間 uchar seth_mi;//高時間 uchar setl_mi;//低時間 bit hlbz;//高低標志 bit clbz; bit spbz; ///定時中斷程序/// void t0 (void) interrupt 1 using 0 { TH0=(65536-200)/256;//5ms*200=1000ms=1s TL0=(65536-200)%256; clo=!clo;//產生時鐘 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++; } ///////////// ///////延時/////// 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;//定時0 16位工作模式 TH0=(65536-200)/256; TL0=(65536-200)%256; TR0=1; //開始計時 ET0=1; //開定時0中斷 EA=1; //開全中斷 while(1) { ST=0; _nop_(); ST=1; _nop_(); ST=0; // EOC=0; xianshi(); while(!EOC) { xianshi(); } xianzhi=P2; xianshi(); doing(); } }
上傳時間: 2013-10-16
上傳用戶:黃蛋的蛋黃
我近期計劃陸續整理出以下幾個方面的學習筆記:初學 ModelSimSE 時被迷糊了幾天的若干概念;在 ModelSimSE 中添加 ALTERA 仿真庫的詳細步驟;用 ModelSimSE 進行功能仿真和時序仿真的方法(ALTERA 篇);ModelSimSE 中常用到的幾個命令及 DO文件的學習筆記;近來學到的幾招 TestBench 的技巧
上傳時間: 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.
標簽: monitors retrieve minutes server
上傳時間: 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.
標簽: Communications demonstrate API Telephony
上傳時間: 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
標簽: eGroupWare multi-user developed PHP-based
上傳時間: 2015-02-20
上傳用戶:hphh
最新的支持向量機工具箱,有了它會很方便 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.
上傳時間: 2013-12-16
上傳用戶:亞亞娟娟123
由于時間緊迫及事先準備不足,編譯器最后定型時暴露出不少問題及不足之處,主要有以下一些方面: 不支持數組數據類型,這是文法分析器設計時的一個疏漏,由于時間關系,最后只得把掃描器中已做好的相關的數組部分刪去。 對于float數據類型的支持,直到語義分析都是正常的,也能生成相應的匯編代碼,但由于我們對8086/8088指令系統本身了解不足,這樣的匯編代碼將只能做到含義上完全忠實于源程序,但不能運行。 對于局部變量的支持,則于時間緊迫,所有的局部變量全被處理成靜態變量。使遞歸函數不能得到正確的結果。 對于函數調用語句,不進行參數匹配檢查,如果參數數量不對,也將能通過編譯,但運行時將產生非法操作。 對&& !等邏輯操作在最后生成代碼時處理比較粗燥,生成的代碼在邏輯復雜時將不能保證運行正常。 接下來有一些,不能說是缺陷,但必須說明的問題: 對于main函數,沒有參數表,通回類型也必須為void,但如果寫上參數表及其他返回類型也能編譯通過,生成代碼時將簡單地忽略,不影響最后的代碼的運行。 對于while,for,if語句,其語句體不管是一句還是多句,必須都有{}圍起來。這跟C語言中若是一句則可省略{}不同。
標簽:
上傳時間: 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.
標簽: access Flash database remember
上傳時間: 2014-01-04
上傳用戶:小碼農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
標簽: maxsize PreOrderUn SqStack typedef
上傳時間: 2014-01-26
上傳用戶:hewenzhi