全文预览

HS1101湿度测量电路及程序

上传者:梦&殇 |  格式:doc  |  页数:7 |  大小:0KB

文档介绍
temp0=1;temp1=(6734-f)*10/116;}if((6503<f)&&(f<=6618)){temp0=2;temp1=(6618-f)*10/115;}if((6388<f)&&(f<=6503)){temp0=3;temp1=(6503-f)*10/115;}if((6271<f)&&(f<=6388)){temp0=4;temp1=(6388-f)*10/117;}if((6152<f)&&(f<=6271)){temp0=5;temp1=(6271-f)*10/119;}if((6029<f)&&(f<=6152)){temp0=6;temp1=(6152-f)*10/123;}if((5901<f)&&(f<=6029)){temp0=7;temp1=(6029-f)*10/128;}if((5766<f)&&(f<=5901)){temp0=8;temp1=(5901-f)*10/135;}if((5623<f)&&(f<=5766)){temp0=9;temp1=(5766-f)*10/143;}}else{temp0=0;temp1=0;}}voidmain(){uchari,k;ucharcount;Init_timer();count=0;while(1){for(i=0;i<200;i++)for(k=0;k<200;k++);//延时tran();temp0&=0x0F;temp1&=0x0F;temp0=temp0<<4;count=temp0|temp1;Ddisp(count);}如图2所示,将该湿敏电容Cx置于555振荡电路之中,将电容的变化转换为与之成反比的电压频率信号,该频率信号可以直接被微控器采集。振荡电路的两个暂稳态输出频率变化的方波信号(图3中U4的3脚输出)的高电平时间为输出低电平时间为因此输出方波信号的周期为即

收藏

分享

举报
下载此文档