温湿度传感器 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
上传用户:黄蛋的蛋黄
Displaying a large bitmap file on a dialog box, in its original size, is quite difficult in the VC++ environment. However, it is possible to display a large bitmap to a predefined area of the dialog by using the StretchBlt( ) function.The major disadvantage of this is that the clarity of the image will be lost. Check out this article for displaying large bitmaps into the desired area of your dialog box in its original size with a scrolling technique used to show the entire bitmap. 滚动显示位图 在VC++环境下,在一个对话框中显示一个原始尺寸的大小的位图文件相当是困难的。然而,通过使用 StretchBlt()函数一个给定的区域显示一个大的位图是可能的。主要的缺点是图像将会失真。看了这篇通过卷动技术显示整个位图技术的文章,你将能够以它的原始尺寸在给定对话框的区域内显示一个大位图。 来源: http://www.codeguru.com/bitmap/ScrollBitmap.html
标签: Displaying difficult original bitmap
上传时间: 2014-01-05
上传用户:yiwen213
Mantis an easily deployable, web based bugtracker to aid product bug tracking. It requires PHP, MySQL and a web server. It is simpler than Bugzilla and easily editable. Check out the online Demo.
标签: deployable bugtracker requires tracking
上传时间: 2014-01-25
上传用户:小宝爱考拉
说明:本程序用于矩形截面偏心受压构件对称配筋的设计和复核以及不对称配筋的复核。本程序有文件支持,但无需建立数据文件,请按屏幕提示输入数据,并注意单位。本程序可在此文件同目录上自动生成下列文件:设计数据文件“design.dat”,设计结果文件“design.out”;复核数据文件“verify.dat”,复核结果文件“verify.out”。
上传时间: 2015-03-19
上传用户:xinzhch
这是关于文件操作的一个题,由题意可知,该题解决起来应该分为三个部分。第一部分即从in.dat中读入数据,第二部分即实现排序的算法,最后应该实现将排序的结果输出到out.dat中。
标签: 文件操作
上传时间: 2014-01-12
上传用户:coeus
Training embedded apps to process speech may be as easy as finding the right 8-bit micro. Don t let what Rodger has to say about using an ADPCM algorithm and PWM output to generate speech to go in one ear and out the other
标签: Training embedded process finding
上传时间: 2014-01-26
上传用户:plsee
增加ASCII.C的一个ASCI码(7F),用于虚拟按键用 修改UART串口的命令解析程序,修改RTC的pcf8563中断部分。 精简IIC和smart_timer代码,添加define.h的宏定义。 修改system.c里的消息堆栈的宏定义 增加ii.c函数,支持对eeprom的打包 增加由PLD或者GPIO输出的模拟UART,在6个CLOCK下速度为57.6K 增加消息的优先级功能,消息类型的前4位为消息的优先级,后4位为消息的类型 试用于初学单片机并且想更上一层楼的,或者有些基础,想减少工作量的。
上传时间: 2015-04-10
上传用户:athjac
随机性发生器、冒泡分类和混洗一组12张牌的演示程序。 Demonstrates the use of a randomizer, bubble-sort and an array to "shuffle" a deck of 12 cards. I put it here for those of you who are trying to figure out how to shuffle with a randomizer without having the same card appear two-or-more times.
标签: Demonstrates bubble-sort randomizer array
上传时间: 2014-01-16
上传用户:zhanditian
CBC下写的串口编程,API函数实例 I wish this site had been around when I was trying to figure out how to make serial communications work in Windows95. I, like many programmers, was hit with the double-whammy of having to learn Windows programming and Win95 serial comm programming at the same time. I found both tasks confusing at best. It was particularly frustrating because I had, over the years, written so much stuff (including lots of serial comm software) for the DOS environment and numerous embedded applications. Interrupt driven serial comm, DMA transfer serial comm, TSR serial comm, C, assembler, various processors... you name it, it had written it. Yet, everything I knew seemed upside-down in the message-driven-callback world of Windows.
上传时间: 2014-06-20
上传用户:cccole0605
三星arm9处理器,s3c2410的开关量书输入输出(gpio)的驱动
上传时间: 2015-04-27
上传用户:yzy6007