/**************************************************************** 外部晶振8M PA0~3:四位数码管的位选 PB0~7:数码管的8位段选 外部中断0用于计数 定时器0溢出中断的定时为1ms 说明 :检测到水流较小时,继电器延时1秒关闭 ******************************************************************/ #include<iom16v.h> #include<macros.h> #define uchar unsigned char #define uint unsigned int char led_7[10]={0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x6F}; //数码管段选 char position[4]={0xfe,0xfd,0xfb,0xf7};//数码管位选 uint sumnum=0; //用于记录1000ms内进入中断的次数 uint time=0; //记录进入比较定时器0的次数 uint num=0; //记录1ms内进入中断的次数 uint count=0; //进入外部中断0的次数 uchar flag; uint sumnum1; //记录100ms内的数目 /***************************函数声明***************************/ void delay(); void display(uint m ); void init(); void init_0(); void init_2(); void _delay_us(uint l) { unsigned int i; for(i=0;i<l;i++) { asm("nop"); } } /**************************主函数***********************************/ void main() { init(); init_0(); init_2(); while(sumnum<5) { PORTD=0XBF; segdisplay(sumnum1); } while(1) { segdisplay(sumnum1); } } /*************************扫描数码管时的延时函数*********************/ void delay() { uchar i,j; for(i=6;i>0;i--) for(j=225;j>0;j--); } /************************数码管显示函数*****************************/ void segdisplay( int temp) { int seg[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f}; int temp1,temp2,temp3,temp4; temp1=temp/1000; temp2=(temp/100)%10; temp3=(temp/10)%10; temp4=temp%10; DDRB=0xff; DDRA|=0x0f; PORTA=~BIT(3); PORTB=seg[temp1]; _delay_us(100); PORTA=~BIT(2); PORTB=seg[temp2]; _delay_us(100); PORTA=~BIT(1); PORTB=seg[temp3]; _delay_us(100); PORTA=~BIT(0); PORTB=seg[temp4]; _delay_us(100); } /***********************管脚初始化函数*********************/ void init() { DDRD|=0X40; //PD4 设置为输出 PORTD=0XBF; DDRA=0XFF; DDRB=0XFF; PORTA=0XFF; PORTB=0XFF; } /***********************外部中断0初始化*********************/ void init_0() { MCUCR=0X02; //INT0为下降沿触发 GICR=0X40; //使能INT0中断 SREG=0X80; //使能总中断 } /**********************定时器2初始化***********************/ void init_2() { TCCR0=0x03; // 内部时钟,64 分频(8M/64=125KHz) TCNT0=0x83; //装初值 TIMSK=0x01; // 允许 T/C0溢出中断中断 } /***********************外部中断0子函数********************/ #pragma interrupt_handler int0_isr:2 void int0_isr(void) { count++; } /*********************定时计数器0溢出中断子函数*****************/ #pragma interrupt_handler int0_over:10 void int0_over(void) { TCNT0=0x83; //重装初值 if((time%100) == 0) sumnum1 = num; if(time == 1000) { sumnum=num; if(sumnum<10) { if((flag==1)&&(sumnum<10)) { PORTD=0XFF; flag=0; } flag++; } else PORTD=0XBF; num=0; time=0; } num+=count; count=0; ++time; }
标签: C语言
上传时间: 2016-03-09
上传用户:彦 yan
Computational models are commonly used in engineering design and scientific discovery activities for simulating complex physical systems in disciplines such as fluid mechanics, structural dynamics, heat transfer, nonlinear structural mechanics, shock physics, and many others. These simulators can be an enormous aid to engineers who want to develop an understanding and/or predictive capability for complex behaviors typically observed in the corresponding physical systems. Simulators often serve as virtual prototypes, where a set of predefined system parameters, such as size or location dimensions and material properties, are adjusted to improve the performance of a system, as defined by one or more system performance objectives. Such optimization or tuning of the virtual prototype requires executing the simulator, evaluating performance objective(s), and adjusting the system parameters in an iterative, automated, and directed way. System performance objectives can be formulated, for example, to minimize weight, cost, or defects; to limit a critical temperature, stress, or vibration response; or to maximize performance, reliability, throughput, agility, or design robustness. In addition, one would often like to design computer experiments, run parameter studies, or perform uncertainty quantification (UQ). These approaches reveal how system performance changes as a design or uncertain input variable changes. Sampling methods are often used in uncertainty quantification to calculate a distribution on system performance measures, and to understand which uncertain inputs contribute most to the variance of the outputs. A primary goal for Dakota development is to provide engineers and other disciplinary scientists with a systematic and rapid means to obtain improved or optimal designs or understand sensitivity or uncertainty using simulationbased models. These capabilities generally lead to improved designs and system performance in earlier design stages, alleviating dependence on physical prototypes and testing, shortening design cycles, and reducing product development costs. In addition to providing this practical environment for answering system performance questions, the Dakota toolkit provides an extensible platform for the research and rapid prototyping of customized methods and meta-algorithms
标签: Optimization and Uncertainty Quantification
上传时间: 2016-04-08
上传用户:huhu123456
L E D 流 星 雨 灯 程 序 代 码
上传时间: 2016-05-23
上传用户:huatuo
简单命令使用grep等的使用 [zorro@isch ~]$ history 1 ifconfig 2 su 3 exit 4 ls 5 cd Desktop/ 6 ls 7 tar zxcf VMwareTools-8.4.5-324285.tar.gz 8 tar zxvf VMwareTools-8.4.5-324285.tar.gz 9 cd vmware-tools-distrib/ 10 ls 11 ./vmware-install.pl 12 su 13 ls 14 cd .. 15 ls 16 rm VMwareTools-8.4.5-324285.tar.gz 17 rm -r vmware-tools-distrib 18 ls 19 make 20 ls 21 cd redis/ 22 quit 23 ls 24 ca redis/ 25 cd redis/ 26 cd redis-2.8.17 27 make 28 cd redis-2.8.17 29 ls 30 cd redis-2.8.17 31 cd str 32 cd src 33 ls 34 ./redis-cli 35 ls 36 cd redis-2.8.17 tar.gz 37 make 38 cd src 39 ./redis-server .. /redis.conf 40 ./redis-cli 41 ./redis-server ../redis.conf 42 vi test1.sh 43 ./test1.sh 44 vi test.sh 45 ./test.sh 46 ls 47 chmod 777 test.sh 48 ./test.sh 49 vi express 50 $ grep –n ‘the’ express 51 clear 52 grep -n 'the' express 53 vi express 54 grep -n 'the' express 55 grep -vn 'the'express 56 grep -vn 'the' express 57 grep -in 'the' express 58 vi test2.c 59 grep -l 'the' *.c 60 grep -n 't[ae]st' express 61 grep -n 'oo' express 62 grep -n '[^g]oo' express 63 grep -n '[a^z]oo' express 64 grep -n '[0^9]' express 65 grep -n '^the' express 66 vi express 67 sed -e 'd' express 68 sed -e '1d' express 69 sed -e '1~7d' express 70 sed -e '$d' express 71 sed -e '1,/^$/d' express 72 ls 73 cd 74 pwd 75 history [zorro@isch ~]$
标签: 简单命令使用
上传时间: 2016-05-24
上传用户:12345678gan
springMVC有三个映射器,如果不定义映射Mapping,那么就会使默认: l <bean class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping"></bean> 也就是说:上面这个定义和不定义都是一样的。 不定义: <bean id="testController" name="/hello.do" class="cn.itcast.controller.TestController"></bean> 直接使用:hello.do来访问。 <!-- 简单的url映射处理器 --> l <bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> <property name="mappings"> <props> 那么上面的这个映射配置:表示多个*.do文件可以访问多个Controller或者一个Controller。 前提是:都必须依赖: <bean id="testController" name="/hello.do" class="cn.itcast.controller.TestController"></bean> <!-- /WEB-INF/jsp/index.jsp --> <bean class="org.springframework.web.servl <prop key="/hello1.do">testController</prop> <prop key="/a.do">testController</prop> </props> </property> </bean> et.view.InternalResourceViewResolver"> <property name="prefix" value="/WEB-INF/jsp/"></property> <property name="suffix" value=".jsp"></property> </bean>
标签: SpringMVC
上传时间: 2016-06-03
上传用户:hthunder
电感感测是一种遥控的、短程感测技术,此项技术能够 • 亚微米高精度 在灰尘、污垢、油和潮湿环境中实现导体目标的低成 • 可调感测范围(通过线圈设计实现) 本、高分辨率感测,这使得它在恶劣环境中非常可靠。 • 更低的系统成本 通过使用可在印刷电路板 (PCB) 上被创建为一个感测 • 远程传感器放置(从恶劣环境中将 LDC 去耦合) 元件的线圈,LDC1000 可实现超低成本系统解决方 • 高耐久性(借助于遥控操作) 案。 • 对于环境干扰的不敏感性(诸如污垢、灰尘、水、 电感感测技术可实现线性/角位置、位移、运动、压 油) 缩、振动、金属成分以及市面上包括汽车、消费类、计 • 电源电压,模拟:4.75V 至 5.25V 算机、工业用、医疗用和通信应用在内的很多其它应用 • 电源电压,IO:1.8V 至 5.25V 的高精度测量。 电感感测以低于其它竞争对手解决方 • 电源电流(无 LC 谐振回路):1.7mA 案的成本提供更佳的性能和可靠性。 • Rp 分辨率:16 位 • L 分辨率:24 位 LDC1000 是世界上第一个电感数字转换器,从而在一 • LC 频率范围:5kHz 至 5MHz 个低功耗、小封装尺寸解决方案内提供电感感测的优 势。 此产品采用一个小外形尺寸无引线 (SON)-16 封 应用范围 装,并且提供了几种运行模式。 一个串行外设接口 • 电传线控系统 (SPI) 简化了到微控制器 (MCU) 的连接
上传时间: 2016-07-26
上传用户:461449632
关于本课程. Ubuntu 是基于 Linux 的操作系统,它由社区开发,可供免费使用,广泛适用于笔记本 等各种设备。本课程以 Ubuntu 9.10 版本系统的使用为例,旨在对于一些主要程序诸如主流的办公室 浏览、图像处理工具、多媒体工具和音乐工具等的使用方面给新的 Ubuntu 用户以简单的入门指导 l 开源的概念和开源在 Ubuntu 之中的体现 l 使用 Ubuntu 的好处 l 如何自定义 Ubuntu 桌面的观感 l 如何在文件系统中进行浏览和查找文件 l 如何连接并使用互联网 l 如何使用 OpenOffice.org 进行简单的文本处理和使用电子表格 l 如何安装和运行游戏 l 如何添加、删除和更新应用程序 l 如何查看、绘制、处理和扫描图像 l 如何播放、编辑和管理您的音乐和视频文件 l 如何从免费的或商业的资源中获取关于 Ubuntu 的帮助 l 如何创建分区和使用双启动选项
上传时间: 2016-08-30
上传用户:chengxin
SSCOM32使用说明: 将用户程序通过串口的方式下载到ATT7025/7027中。 使用步骤: (1)选择通讯口,然后打开串口,如下图所示 (2)将DTR打勾,DTR对应芯片的TMS1脚,也就是说通过将DTR打勾将TMS1拉为低电平 (3)将RTS打勾,然后将勾取消,RTS对应芯片的外部复位引脚,通过将RTS打勾将芯片外部复位引脚拉低,使芯片处于复位状态,然后将RTS拉高,使得芯片完成复位。 (4)将鼠标移动到上面的大文本框,点击回车按键,然后可以看到有返回信号,如下图所示: (5)从键盘输入 “M0000” ,会有如下返回信号,如下图所示,通过这个命令将芯片内的24Kflash擦除 (6)从键盘输入 “M8000” ,会有如下返回信号,如下图所示,通过这个命令将芯片内的8Kflash擦除 (7)从键盘输入 “E”,如下所示: 说明:键入“E”后,不再显示随后键入的字符,但所键入字符可通过串口访问芯片。 (8)从键盘输入 “L”,此时不会再看到返回字符,然后点击打开文件,选择用户需要下载的hex文件 说明:键入“L”是Load命令,此时可以打开一个hex文件进行写Flash操作。 (9)点击发送文件,如下图所示: (10)当正确传输完成时,如下图所示: 上图中的情况说明程序下载正确。 (11)将DTR的勾取消,也就是说将芯片的TMS1拉高,将芯片切换到Normal模式,将RTS拉低再拉高,也就是说将芯片复位一次,此时芯片内的程序就开始正常运行了。 软件标签: 串口调试 软件截图 亲 如果您觉得西西能给您带来帮助请帮西西给个好评下谢谢 :)
标签: sscom32免注册版本
上传时间: 2016-09-22
上传用户:wangliya888
根据需求分析的描述以及与用户的沟通,本系统实现目标如下: l 界面设计简洁、友好、美观大方。 l 操作简单、快捷方便 l 数据存储安全、可靠。 l 信息分类清晰、准确。 l 强大的查询功能,保证数据查询的灵活性。 l 提供销售排行榜,为管理员提供真实的数据信息。 l 提供灵活、方便的权限设置功能,使整个系统的管理分工明确。 对用户输入的数据,系统进行严格的数据检验,尽可能排除人为的错误
标签: 进销存
上传时间: 2016-09-26
上传用户:insomnia
说明: a) 单字符用于子站向主站传输的确认(肯定或否定); b) 控制域是用来区别不同的帧和数据传输方向的单字节,详见第二节; c) 地址域是链路地址(一般是RTU编号),2字节,低字节在前,高字节在后; d) 帧校验是用户数据区的各字节的算术和对256的模; e) 变长帧中的L为用户数据区的长度,2个L相等; f) 变长帧中的ASDU为应用服务数据单元,详见第三节; g) 数据传输方式:是异步传输方式,11位,其中启动位为二进制0,数据位8位,一个偶校验位,一个停止位。
标签: 102
上传时间: 2016-12-14
上传用户:ts7089524