本代码为编码开关代码,编码开关也就是数字音响中的 360度旋转的数字音量以及显示器上用的(单键飞梭开 关)等类似鼠标滚轮的手动计数输入设备。 我使用的编码开关为5个引脚的,其中2个引脚为按下 转轮开关(也就相当于鼠标中键)。另外3个引脚用来 检测旋转方向以及旋转步数的检测端。引脚分别为a,b,c b接地a,c分别接到P2.0和P2.1口并分别接两个10K上拉 电阻,并且a,c需要分别对地接一个104的电容,否则 因为编码开关的触点抖动会引起轻微误动作。本程序不 使用定时器,不占用中断,不使用延时代码,并对每个 细分步数进行判断,避免一切误动作,性能超级稳定。 我使用的编码器是APLS的EC11B可以参照附件的时序图 编码器控制流水灯最能说明问题,下面是以一段流水 灯来演示。
上传时间: 2017-07-03
上传用户:gaojiao1999
【问题描述】 在一个N*N的点阵中,如N=4,你现在站在(1,1),出口在(4,4)。你可以通过上、下、左、右四种移动方法,在迷宫内行走,但是同一个位置不可以访问两次,亦不可以越界。表格最上面的一行加黑数字A[1..4]分别表示迷宫第I列中需要访问并仅可以访问的格子数。右边一行加下划线数字B[1..4]则表示迷宫第I行需要访问并仅可以访问的格子数。如图中带括号红色数字就是一条符合条件的路线。 给定N,A[1..N] B[1..N]。输出一条符合条件的路线,若无解,输出NO ANSWER。(使用U,D,L,R分别表示上、下、左、右。) 2 2 1 2 (4,4) 1 (2,3) (3,3) (4,3) 3 (1,2) (2,2) 2 (1,1) 1 【输入格式】 第一行是数m (n < 6 )。第二行有n个数,表示a[1]..a[n]。第三行有n个数,表示b[1]..b[n]。 【输出格式】 仅有一行。若有解则输出一条可行路线,否则输出“NO ANSWER”。
标签: 点阵
上传时间: 2014-06-21
上传用户:llandlu
随着微电子技术的迅猛发展,集成电路组成的电子系统集成度越来越高,使得芯片 的复杂性不断上升,单片的成本却不断降低。FPGA产品的逻辑单元越来越多,性能越 来越高,单位成本和功耗向越来越低的方向发展,使得可编程片上系统SOPC(System On Programmable Chip)设计成为必然趋势。SD存储卡因具备体积小、储容量高、可擦写、 价格低以及非易失性等特点被广泛应用于手机、数码相机、MP3播放器等领域。 美国Altera公司开发的基于SOPC技术的Nios U嵌入式处理器,是一个可变结构、 通用型的32位RISC嵌入式处理器,设计者可以非常方便地使用SOPC Builder系统开 发工具设计构造以处理器为基础的系统,针对自己的要求配置Nios II软核、Avalon总 线及外围接口系统,体现了面向用户,面向应用的SOPC技术设计思想。应用与Nios II 相关的集成开发平台和辅助开发工具,加快了NiosⅡ系统的设计与验证环节的开发速 度,对于嵌入式系统的产品开发和应用,具有广泛的价值和积极的意义。 本文介绍了基于Nios II嵌入式处理器的SOPC系统的软、硬件设计方法,结合实 验平台资源特点,构建了基于Nios II软核处理器的SD
上传时间: 2015-05-25
上传用户:wjc511
实验源代码 //Warshall.cpp #include<stdio.h> void warshall(int k,int n) { int i , j, t; int temp[20][20]; for(int a=0;a<k;a++) { printf("请输入矩阵第%d 行元素:",a); for(int b=0;b<n;b++) { scanf ("%d",&temp[a][b]); } } for(i=0;i<k;i++){ for( j=0;j<k;j++){ if(temp[ j][i]==1) { for(t=0;t<n;t++) { temp[ j][t]=temp[i][t]||temp[ j][t]; } } } } printf("可传递闭包关系矩阵是:\n"); for(i=0;i<k;i++) { for( j=0;j<n;j++) { printf("%d", temp[i][ j]); } printf("\n"); } } void main() { printf("利用 Warshall 算法求二元关系的可传递闭包\n"); void warshall(int,int); int k , n; printf("请输入矩阵的行数 i: "); scanf("%d",&k); 四川大学实验报告 printf("请输入矩阵的列数 j: "); scanf("%d",&n); warshall(k,n); }
上传时间: 2016-06-27
上传用户:梁雪文以
#include "iostream" using namespace std; class Matrix { private: double** A; //矩阵A double *b; //向量b public: int size; Matrix(int ); ~Matrix(); friend double* Dooli(Matrix& ); void Input(); void Disp(); }; Matrix::Matrix(int x) { size=x; //为向量b分配空间并初始化为0 b=new double [x]; for(int j=0;j<x;j++) b[j]=0; //为向量A分配空间并初始化为0 A=new double* [x]; for(int i=0;i<x;i++) A[i]=new double [x]; for(int m=0;m<x;m++) for(int n=0;n<x;n++) A[m][n]=0; } Matrix::~Matrix() { cout<<"正在析构中~~~~"<<endl; delete b; for(int i=0;i<size;i++) delete A[i]; delete A; } void Matrix::Disp() { for(int i=0;i<size;i++) { for(int j=0;j<size;j++) cout<<A[i][j]<<" "; cout<<endl; } } void Matrix::Input() { cout<<"请输入A:"<<endl; for(int i=0;i<size;i++) for(int j=0;j<size;j++){ cout<<"第"<<i+1<<"行"<<"第"<<j+1<<"列:"<<endl; cin>>A[i][j]; } cout<<"请输入b:"<<endl; for(int j=0;j<size;j++){ cout<<"第"<<j+1<<"个:"<<endl; cin>>b[j]; } } double* Dooli(Matrix& A) { double *Xn=new double [A.size]; Matrix L(A.size),U(A.size); //分别求得U,L的第一行与第一列 for(int i=0;i<A.size;i++) U.A[0][i]=A.A[0][i]; for(int j=1;j<A.size;j++) L.A[j][0]=A.A[j][0]/U.A[0][0]; //分别求得U,L的第r行,第r列 double temp1=0,temp2=0; for(int r=1;r<A.size;r++){ //U for(int i=r;i<A.size;i++){ for(int k=0;k<r-1;k++) temp1=temp1+L.A[r][k]*U.A[k][i]; U.A[r][i]=A.A[r][i]-temp1; } //L for(int i=r+1;i<A.size;i++){ for(int k=0;k<r-1;k++) temp2=temp2+L.A[i][k]*U.A[k][r]; L.A[i][r]=(A.A[i][r]-temp2)/U.A[r][r]; } } cout<<"计算U得:"<<endl; U.Disp(); cout<<"计算L的:"<<endl; L.Disp(); double *Y=new double [A.size]; Y[0]=A.b[0]; for(int i=1;i<A.size;i++ ){ double temp3=0; for(int k=0;k<i-1;k++) temp3=temp3+L.A[i][k]*Y[k]; Y[i]=A.b[i]-temp3; } Xn[A.size-1]=Y[A.size-1]/U.A[A.size-1][A.size-1]; for(int i=A.size-1;i>=0;i--){ double temp4=0; for(int k=i+1;k<A.size;k++) temp4=temp4+U.A[i][k]*Xn[k]; Xn[i]=(Y[i]-temp4)/U.A[i][i]; } return Xn; } int main() { Matrix B(4); B.Input(); double *X; X=Dooli(B); cout<<"~~~~解得:"<<endl; for(int i=0;i<B.size;i++) cout<<"X["<<i<<"]:"<<X[i]<<" "; cout<<endl<<"呵呵呵呵呵"; return 0; }
标签: 道理特分解法
上传时间: 2018-05-20
上传用户:Aa123456789
电学中的测量技术涉及范围非常广,电流测量在电学计量中占有非常重要的位置。如何精确地进行电流测量是精密测量的一大难题。传统的电流检测电路多采用运算放大芯片与片外电流检测电路相结合的方式,电路集成度很低,需要较多的接口和资源才能完成对电路的检测。本文把所有电路部分都集成在一块芯片上,包括检测电阻,运算放大器电路及模拟转数字转换电路,从而在电路内部可以进行电流检测,使电路更好的集成化。前置电路使用二级共源共栅结构的运算放大器,减小沟道长度调制效应造成的电流误差。10位SAR ADC中采用电容驱动能力强的传输门保证了模数转化器的有效精度。比较器模块采用再生锁存器与迟滞比较器作为基础单元组合解决精密测量的问题。本设计可以作为嵌入芯片内的一小部分而检测芯片中的微小电流1mA~100mA,工作电压在1.8v左右,电流检测精度预期达到10uA的需求。The measurement technology in electricity involves a wide range,and current measurement plays a very important position in electrical measurement.How to accurately measure current is a big problem in precision measurement. The traditional current detecting circuit adopts the combination of the operational amplifier chip and theoff-chip current detecting circuit, The circuit integration is very low, and more interfaces and resources are needed tocomplete the circuit detection.This topic integrates all the circuit parts into one chip, including detection resistance, operational amplifier circuit andanalog to digital conversion circuit. Highly integrated circuit makes the external resources on the chip more intensive,so that current detection can be carried out inside the circuit, so that the circuit can be better integrated. Thefront-end circuit of this project uses two-stage cascade operational amplifier and cascade tube to reduce the currenterror caused by channel length modulation effect. In 10-bit SAR ADC, the transmission gate with strong capacitivedriving ability ensures the effective accuracy of the analog-to-digital converter. Comparator module uses regenerativelatch and hysteresis comparator as basic unit to solve the difficult problem of precision measurement. This topic can beused as a small part of the embedded chip to detect the micro-current in the chip 1 mA~100 mA, the working voltageis about 1.8v, and the current detection accuracy is expected to reach the requirement of 10 uA.
上传时间: 2022-04-03
上传用户:
基于TMS320F28035芯片为控制核心的空间矢量异步电机变频器 我们设计的异步电机变频调速器以TMS320F28035芯片为控制核心,通过输出三相PWM波控制智能功率模块IPM驱动三相异步电机。我们使用空间矢量SVPWM算法,并对其进行了优化。采用检测反电势的方法省去了昂贵的光电编码器,大大节省了成本。同时开创性的研发了自动根据运行环境调节的自适应变频算法,使我们的变频调速器可以在电网条件恶劣的乡村山区工作,由此该变频器已被一家民用水泵生产企业预订。关键字 变频器 TMS320f28035 IPM SVPWM In our design, the asynchronous machine inverter based on the chip of TMS320F28035 drives the three-Phase asynchronous machine by sending three-phase PWM waves to the IPM, which is short for the Intelligent-Power-Module. The SVPWM (space vector pulse width modulation) strategy is applied to our control algorithm and we optimize it mainly in two aspects. Firstly the inverter detects the speed by measuring the Back EMF instead of installing an expensive photoelectric encoder for costs reduction.
标签: tms320f28035 芯片
上传时间: 2022-05-08
上传用户:zhanglei193
说明: 基于stm32f103c8t6单片机的步进电机控制源码,固件库为3.5版本(Based on single-chip stepper motor control stm32f103c8t6 source firmware library version 3.5)
标签: stm32f103c8t6 单片机 步进电机
上传时间: 2022-05-16
上传用户:xsr1983
说明: 基于单片机的rc522模块的门禁系统源码以及原理图(The source code and schematic diagram of the entrance guard system of rc522 module based on single chip microcomputer)
标签: 门禁系统
上传时间: 2022-06-06
上传用户:ttalli
AR0231AT7C00XUEA0-DRBR(RGB滤光)安森美半导体推出采用突破性减少LED闪烁 (LFM)技术的新的230万像素CMOS图像传感器样品AR0231AT,为汽车先进驾驶辅助系统(ADAS)应用确立了一个新基准。新器件能捕获1080p高动态范围(HDR)视频,还具备支持汽车安全完整性等级B(ASIL B)的特性。LFM技术(专利申请中)消除交通信号灯和汽车LED照明的高频LED闪烁,令交通信号阅读算法能于所有光照条件下工作。AR0231AT具有1/2.7英寸(6.82 mm)光学格式和1928(水平) x 1208(垂直)有源像素阵列。它采用最新的3.0微米背照式(BSI)像素及安森美半导体的DR-Pix™技术,提供双转换增益以在所有光照条件下提升性能。它以线性、HDR或LFM模式捕获图像,并提供模式间的帧到帧情境切换。 AR0231AT提供达4重曝光的HDR,以出色的噪声性能捕获超过120dB的动态范围。AR0231AT能同步支持多个摄相机,以易于在汽车应用中实现多个传感器节点,和通过一个简单的双线串行接口实现用户可编程性。它还有多个数据接口,包括MIPI(移动产业处理器接口)、并行和HiSPi(高速串行像素接口)。其它关键特性还包括可选自动化或用户控制的黑电平控制,支持扩频时钟输入和提供多色滤波阵列选择。封装和现状:AR0231AT采用11 mm x 10 mm iBGA-121封装,现提供工程样品。工作温度范围为-40℃至105℃(环境温度),将完全通过AEC-Q100认证。
标签: 图像传感器
上传时间: 2022-06-27
上传用户:XuVshu