虫虫首页| 资源下载| 资源专辑| 精品软件
登录| 注册

input-events

  • 温湿度传感器 sht11 仿真程序下载

    温湿度传感器 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();  }  }

    标签: sht 11 温湿度传感器 仿真程序

    上传时间: 2013-10-16

    上传用户:黄蛋的蛋黄

  • Arduino应用_Arduino连接超声波传感器测距

    超声波传感器适用于对大幅的平面进行静止测距。普通的超声波传感器测距范围大概是 2cm~450cm,分辨率3mm(淘宝卖家说的,笔者测试环境没那么好,个人实测比较稳定的 距离10cm~2m 左右,超过此距离就经常有偶然不准确的情况发生了,当然不排除笔者技术 问题。) 测试对象是淘宝上面最便宜的SRF-04 超声波传感器,有四个脚:5v 电源脚(Vcc),触发控制端(Trig),接收端(Echo),地端(GND) 附:SRF 系列超声波传感器参数比较   模块工作原理: 采用IO 触发测距,给至少10us 的高电平信号; 模块自动发送8个40KHz 的方波,自动检测是否有信号返回; 有信号返回,通过IO 输出一高电平,高电平持续的时间就是超声波从发射到返回的时间.测试距离=(高电平时间*声速(340m/s))/2; 电路连接方法   Arduino 程序例子: constintTrigPin = 2; constintEchoPin = 3; floatcm; voidsetup() { Serial.begin(9600); pinMode(TrigPin, OUTPUT); pinMode(EchoPin, INPUT); } voidloop() { digitalWrite(TrigPin, LOW); //低高低电平发一个短时间脉冲去TrigPin delayMicroseconds(2); digitalWrite(TrigPin, HIGH); delayMicroseconds(10); digitalWrite(TrigPin, LOW); cm = pulseIn(EchoPin, HIGH) / 58.0; //将回波时间换算成cm cm = (int(cm * 100.0)) / 100.0; //保留两位小数 Serial.print(cm); Serial.print("cm"); Serial.println(); delay(1000); }

    标签: Arduino 连接 超声波传感器

    上传时间: 2013-11-01

    上传用户:xiaoyuer

  • Full support for extended regular expressions (those with intersection and complement); Support for

    Full support for extended regular expressions (those with intersection and complement); Support for some kinds of cycles in grammar; DFA-based operation; Unicode support; C++ only, requires a modern compiler; Lexical analyzers can be configured to get symbols from any input class (built-in support for std::istream, std::wistream and FILE *); Designed to work with Whale, but can work standalone or interface to other parsers.

    标签: intersection expressions complement for

    上传时间: 2013-12-11

    上传用户:zhanditian

  • (其中已经包含5个源码)所附源程序C或C++代码文件及其可执行文件 Scs.cpp 基本分类算法源程序

    (其中已经包含5个源码)所附源程序C或C++代码文件及其可执行文件 Scs.cpp 基本分类算法源程序, 输入数据文件cfile.txt,efile.txt,gfile.txt,pfile.txt ,rfile.txt,tfile.txt Sga.c 基本遗传算法源程序, 输入数据文件input,输出文件output A_life.c 基于遗传算法的人工生命模拟源程序, 输入数据文件world GA_nn.c 基于遗传算法优化神经网络结构源程序,输入数据文件sample Patmat.c 基于遗传算法提取基元图形源程序

    标签: Scs cpp 源程序 源码

    上传时间: 2014-01-11

    上传用户:13215175592

  • Tug of War(A tug of war is to be arranged at the local office picnic. For the tug of war, the picnic

    Tug of War(A tug of war is to be arranged at the local office picnic. For the tug of war, the picnickers must be divided into two teams. Each person must be on one team or the other the number of people on the two teams must not differ by more than 1 the total weight of the people on each team should be as nearly equal as possible. The first line of input contains n the number of people at the picnic. n lines follow. The first line gives the weight of person 1 the second the weight of person 2 and so on. Each weight is an integer between 1 and 450. There are at most 100 people at the picnic. Your output will be a single line containing 2 numbers: the total weight of the people on one team, and the total weight of the people on the other team. If these numbers differ, give the lesser first. )

    标签: picnic the tug war

    上传时间: 2014-01-07

    上传用户:离殇

  • isp1160_isa_evel_codeUSB主机软件

    isp1160_isa_evel_codeUSB主机软件,可驱动打印机,音频设备,鼠标? size=80>

    标签: isa_evel_codeUSB 1160 isp 主机

    上传时间: 2015-02-21

    上传用户:semi1981

  • The book presents the entire Java programming language and essential parts of the class libraries: t

    The book presents the entire Java programming language and essential parts of the class libraries: the collection classes and the input-output classes.

    标签: programming essential libraries the

    上传时间: 2015-03-02

    上传用户:yulg

  • pdnMesh is an automatic mesh generator and solver for Finite Element problems. It will also do post-

    pdnMesh is an automatic mesh generator and solver for Finite Element problems. It will also do post-processing to generate contour plots and Postscript printouts. GUI support using GTK or MFC (Win32) is available. The problem definition can be done in any form and given to pdnMesh as an input data file. Drawing Exchange Format (DXF) files can be directly imported to pdnmesh. The quality and the coarseness of the mesh can be controlled by giving input parameters.

    标签: automatic generator problems pdnMesh

    上传时间: 2013-12-19

    上传用户:cuibaigao

  • This directory contains code implementing the K-means algorithm. Source codemay be found in KMEANS.C

    This directory contains code implementing the K-means algorithm. Source codemay be found in KMEANS.CPP. Sample data isfound in KM2.DAT. The KMEANSprogram accepts input consisting of vectors and calculates the givennumber of cluster centers using the K-means algorithm. Output isdirected to the screen.

    标签: implementing directory algorithm contains

    上传时间: 2014-01-27

    上传用户:maizezhen

  • 程序存储问题:设有n 个程序{1,2,…, n }要存放在长度为L的磁带上。程序i存放在磁带上的长度是Li

    程序存储问题:设有n 个程序{1,2,…, n }要存放在长度为L的磁带上。程序i存放在磁带上的长度是Li ,1≤i≤n 程序存储问题要求确定这n 个程序在磁带上的一个存储方案,使得能够在磁带上存储尽可能多的程序。 编程任务: 对于给定的n个程序存放在磁带上的长度,编程计算磁带上最多可以存储的程序数。 数据输入:由文件input.txt给出输入数据。第一行是正整数n,表示文件个数。接下来的1 行中,有n 个正整数,表示程序存放在磁带上的长度。 结果输出: input.txt output.txt 6 50 5 2 3 13 8 80 20

    标签: 程序 磁带 长度 程序存储

    上传时间: 2013-12-20

    上传用户:dongqiangqiang