#include<iom16v.h> #include<macros.h> #define uint unsigned int #define uchar unsigned char uint a,b,c,d=0; void delay(c) { for for(a=0;a<c;a++) for(b=0;b<12;b++); }; uchar tab[]={ 0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,
上傳時間: 2013-10-21
上傳用戶:13788529953
三種方法讀取鍵值 使用者設計行列鍵盤介面,一般常採用三種方法讀取鍵值。 中斷式 在鍵盤按下時產生一個外部中斷通知CPU,並由中斷處理程式通過不同位址讀資料線上的狀態判斷哪個按鍵被按下。 本實驗採用中斷式實現使用者鍵盤介面。 掃描法 對鍵盤上的某一行送低電位,其他為高電位,然後讀取列值,若列值中有一位是低,表明該行與低電位對應列的鍵被按下。否則掃描下一行。 反轉法 先將所有行掃描線輸出低電位,讀列值,若列值有一位是低表明有鍵按下;接著所有列掃描線輸出低電位,再讀行值。 根據讀到的值組合就可以查表得到鍵碼。4x4鍵盤按4行4列組成如圖電路結構。按鍵按下將會使行列連成通路,這也是見的使用者鍵盤設計電路。 //-----------4X4鍵盤程序--------------// uchar keboard(void) { uchar xxa,yyb,i,key; if((PINC&0x0f)!=0x0f) //是否有按鍵按下 {delayms(1); //延時去抖動 if((PINC&0x0f)!=0x0f) //有按下則判斷 { xxa=~(PINC|0xf0); //0000xxxx DDRC=0x0f; PORTC=0xf0; delay_1ms(); yyb=~(PINC|0x0f); //xxxx0000 DDRC=0xf0; //復位 PORTC=0x0f; while((PINC&0x0f)!=0x0f) //按鍵是否放開 { display(data); } i=4; //計算返回碼 while(xxa!=0) { xxa=xxa>>1; i--; } if(yyb==0x80) key=i; else if(yyb==0x40) key=4+i; else if(yyb==0x20) key=8+i; else if(yyb==0x10) key=12+i; return key; //返回按下的鍵盤碼 } } else return 17; //沒有按鍵按下 }
上傳時間: 2013-11-12
上傳用戶:a673761058
PCB LAYOUT 術語解釋(TERMS)1. COMPONENT SIDE(零件面、正面)︰大多數零件放置之面。2. SOLDER SIDE(焊錫面、反面)。3. SOLDER MASK(止焊膜面)︰通常指Solder Mask Open 之意。4. TOP PAD︰在零件面上所設計之零件腳PAD,不管是否鑽孔、電鍍。5. BOTTOM PAD:在銲錫面上所設計之零件腳PAD,不管是否鑽孔、電鍍。6. POSITIVE LAYER:單、雙層板之各層線路;多層板之上、下兩層線路及內層走線皆屬之。7. NEGATIVE LAYER:通常指多層板之電源層。8. INNER PAD:多層板之POSITIVE LAYER 內層PAD。9. ANTI-PAD:多層板之NEGATIVE LAYER 上所使用之絕緣範圍,不與零件腳相接。10. THERMAL PAD:多層板內NEGATIVE LAYER 上必須零件腳時所使用之PAD,一般稱為散熱孔或導通孔。11. PAD (銲墊):除了SMD PAD 外,其他PAD 之TOP PAD、BOTTOM PAD 及INNER PAD 之形狀大小皆應相同。12. Moat : 不同信號的 Power& GND plane 之間的分隔線13. Grid : 佈線時的走線格點2. Test Point : ATE 測試點供工廠ICT 測試治具使用ICT 測試點 LAYOUT 注意事項:PCB 的每條TRACE 都要有一個作為測試用之TEST PAD(測試點),其原則如下:1. 一般測試點大小均為30-35mil,元件分布較密時,測試點最小可至30mil.測試點與元件PAD 的距離最小為40mil。2. 測試點與測試點間的間距最小為50-75mil,一般使用75mil。密度高時可使用50mil,3. 測試點必須均勻分佈於PCB 上,避免測試時造成板面受力不均。4. 多層板必須透過貫穿孔(VIA)將測試點留於錫爐著錫面上(Solder Side)。5. 測試點必需放至於Bottom Layer6. 輸出test point report(.asc 檔案powerpcb v3.5)供廠商分析可測率7. 測試點設置處:Setuppadsstacks
上傳時間: 2013-11-17
上傳用戶:cjf0304
微電腦型單相交流集合式電表(單相二線系統) 特點: 精確度0.25%滿刻度±1位數 可同時量測與顯示交流電壓,電流,頻率,瓦特,(功率因數/視在功率) 交流電壓,電流,瓦特皆為真正有效值(TRMS) 交流電流,瓦特之小數點可任意設定 瓦特單位W或KW可任意設定 CT比可任意設定(1至999) 輸入與輸出絕緣耐壓 2仟伏特/1分鐘( 突波測試強度4仟伏特(1.2x50us) 數位RS-485界面 (Optional) 主要規格: 精確度: 0.1% F.S.±1 digit (Frequency) 0.25% F.S.±1 digit(ACA,ACV,Watt,VA) 0.25% F.S. ±0.25o(Power Factor) (-.300~+.300) 輸入負載: <0.2VA (Voltage) <0.2VA (Current) 最大過載能力: Current related input: 3 x rated continuous 10 x rated 30 sec. 25 x rated 3sec. 50 x rated 1sec. Voltage related input: maximum 2 x rated continuous 過載顯示: "doFL" 顯示值范圍: 0~600.0V(Voltage) 0~999.9Hz(Frequency)(<20% for voltage input) 0~19999 digit adjustable(Current,Watt,VA) 取樣時間: 2 cycles/sec. RS-485通訊位址: "01"-"FF" RS-485傳輸速度: 19200/9600/4800/2400 selective RS-485通信協議: Modbus RTU mode 溫度系數: 100ppm/℃ (0-50℃) 顯示幕: Red high efficiency LEDs high 10.16 mm(0.4") 參數設定方式: Touch switches 記憶型式: Non-volatile E²PROM memory 絕緣抗阻: >100Mohm with 500V DC 絕緣耐壓能力: 2KVac/1 min. (input/output/power) 1600 Vdc (input/output) 突波測試: ANSI c37.90a/1974,DIN-IEC 255-4 impulse voltage 4KV(1.2x50us) 使用環境條件: 0-50℃(20 to 90% RH non-condensed) 存放環境條件: 0-70℃(20 to 90% RH non-condensed) CE認證: EN 55022:1998/A1:2000 Class A EN 61000-3-2:2000 EN 61000-3-3:1995/A1:2001 EN 55024:1998/A1:2001
上傳時間: 2015-01-03
上傳用戶:幾何公差
題目:利用條件運算符的嵌套來完成此題:學習成績>=90分的同學用A表示,60-89分之間的用B表示,60分以下的用C表示。 1.程序分析:(a>b)?a:b這是條件運算符的基本例子。
上傳時間: 2015-01-08
上傳用戶:lifangyuan12
數字運算,判斷一個數是否接近素數 A Niven number is a number such that the sum of its digits divides itself. For example, 111 is a Niven number because the sum of its digits is 3, which divides 111. We can also specify a number in another base b, and a number in base b is a Niven number if the sum of its digits divides its value. Given b (2 <= b <= 10) and a number in base b, determine whether it is a Niven number or not. Input Each line of input contains the base b, followed by a string of digits representing a positive integer in that base. There are no leading zeroes. The input is terminated by a line consisting of 0 alone. Output For each case, print "yes" on a line if the given number is a Niven number, and "no" otherwise. Sample Input 10 111 2 110 10 123 6 1000 8 2314 0 Sample Output yes yes no yes no
上傳時間: 2015-05-21
上傳用戶:daguda
此為qpsk的範例,將一訊號分解成I及Q part,再將訊號I及Q部分相加得到輸出
標簽: qpsk
上傳時間: 2015-06-01
上傳用戶:youth25
The government of a small but important country has decided that the alphabet needs to be streamlined and reordered. Uppercase letters will be eliminated. They will issue a royal decree in the form of a String of B and A characters. The first character in the decree specifies whether a must come ( B )Before b in the new alphabet or ( A )After b . The second character determines the relative placement of b and c , etc. So, for example, "BAA" means that a must come Before b , b must come After c , and c must come After d . Any letters beyond these requirements are to be excluded, so if the decree specifies k comparisons then the new alphabet will contain the first k+1 lowercase letters of the current alphabet. Create a class Alphabet that contains the method choices that takes the decree as input and returns the number of possible new alphabets that conform to the decree. If more than 1,000,000,000 are possible, return -1. Definition
標簽: government streamline important alphabet
上傳時間: 2015-06-09
上傳用戶:weixiao99
電力系統在臺穩定計算式電力系統不正常運行方式的一種計算。它的任務是已知電力系統某一正常運行狀態和受到某種擾動,計算電力系統所有發電機能否同步運行 1運行說明: 請輸入初始功率S0,形如a+bi 請輸入無限大系統母線電壓V0 請輸入系統等值電抗矩陣B 矩陣B有以下元素組成的行矩陣 1正常運行時的系統直軸等值電抗Xd 2故障運行時的系統直軸等值電抗X d 3故障切除后的系統直軸等值電抗 請輸入慣性時間常數Tj 請輸入時段數N 請輸入哪個時段發生故障Ni 請輸入每時段間隔的時間dt
上傳時間: 2015-06-13
上傳用戶:it男一枚
上下文無關文法(Context-Free Grammar, CFG)是一個4元組G=(V, T, S, P),其中,V和T是不相交的有限集,S∈V,P是一組有限的產生式規則集,形如A→α,其中A∈V,且α∈(V∪T)*。V的元素稱為非終結符,T的元素稱為終結符,S是一個特殊的非終結符,稱為文法開始符。 設G=(V, T, S, P)是一個CFG,則G產生的語言是所有可由G產生的字符串組成的集合,即L(G)={x∈T* | Sx}。一個語言L是上下文無關語言(Context-Free Language, CFL),當且僅當存在一個CFG G,使得L=L(G)。 *⇒ 例如,設文法G:S→AB A→aA|a B→bB|b 則L(G)={a^nb^m | n,m>=1} 其中非終結符都是大寫字母,開始符都是S,終結符都是小寫字母。
標簽: Context-Free Grammar CFG
上傳時間: 2013-12-10
上傳用戶:gaojiao1999