本代碼為編碼開關代碼,編碼開關也就是數字音響中的 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