freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

基于單片機的單詞記憶測試器的設(shè)計(編輯修改稿)

2024-10-08 02:17 本頁面
 

【文章內(nèi)容簡介】 大學(xué)出版社2003[7] 何立民主編. :北京航空航天大學(xué)出版社2001[8] 劉慶江 張曉光. 一種實用的集成芯片測試儀的設(shè)計. 中國礦業(yè)大學(xué)信息與電氣工程學(xué)院, 200518word memory test deviceabstractThe aim of this paper is to research and design, is based on single chip word memory test device, this word memory test device can achieve the entry word and decide whether the words correctly, inputting words are back after accuracy. The word memory side is functional, in real life in a wide range of applications, especially for learning English has a great role. This paper studies the theory of MCU based on using the latest technology and device, design develop word memory test device scheme. And the main circuit was investigated. Among them main control chip acplished by AT89C52 single, so as to ensure the quality of the signals and flexible modulation mode, in addition, but also increased the input the wrong indicator, facilitate intuitionistic judgment input is correct or not. KEY WORDS :MCU chip word memory test device AT89C52 附 錄單片機單詞記憶測試器C程序源代碼/************************************************************************/**單片機單詞測試程序/**設(shè)計一個以單片機為核心的單詞記憶測試器;/** 實現(xiàn)單詞的錄入(為使程序具有可演示性,單詞不少于10個);/**單詞用按鍵控制依次在屏幕上顯示,按鍵選擇認(rèn)識還是不認(rèn)識,/**也可以直接進入下一個或者上一個;/**單詞背完后給出正確率。/*************************************************************************/define uchar unsigned chardefine uint unsigned intinclude include //ASCII字模表include //12864液晶屏底層驅(qū)動程序bit ERROR=1。 //輸入字符錯誤標(biāo)志位bit result=0。 //輸入結(jié)果對錯的標(biāo)志位,為0是正確bit verify=1。 //已按了確認(rèn)鍵后清零sbit ERR=P2^7。uchar correctNUM。 //統(tǒng)計測試正確的單詞數(shù),即得分/*****************************************/** 存儲要測試的單詞,放在ROM中/****************************************/uchar code S[10][5]={ tree , //樹 rain , //雨 water, //水 fly , //飛 go , //去 fish , //魚 snow , //雪 eat , //吃 rice , //米 ice , //冰 } 。uchar code SL[10]={4,4,5,3,2,4,4,3,4,3}。//存儲各測試單詞的長度uchar KeyNum[8]。 //儲存輸入的單詞/*****************************************/** 存儲鍵盤的字母值 ,放在ROM中/****************************************/uchar code tab1[6][5]={{39。a39。,39。b39。,39。c39。,39。d39。,39。e39。}, {39。f39。,39。g39。,39。h39。,39。i39。,39。j39。}, {39。k39。,39。l39。,39。m39。,39。n39。,39。o39。}, {39。p39。,39。q39。,39。r39。,39。s39。,39。t39。}, {39。u39。,39。v39。,39。w39。,39。x39。,39。y39。}, {39。z39。,1,2,3,4}}。 //最后的 1234 鍵盤值為功能鍵, 1表示確定鍵,2表示不認(rèn)識,3表示上一個,4表示下一個 /*************************************************** 鍵盤掃描程序*************************************************/unsigned char kbscan() //鍵盤掃描 { uchar hang,lie,key。 //P1連行,P3連列 if(P1!=0xFF||P3!=0) { switch(P1amp。0xFF) //P1 掃行 { case 0xFE:hang=5。break。// case 0xFD:hang=4。break。// case 0xFB:hang=3。break。// case 0xF7:hang=2。break。// case 0xEF:hang=1。break。// case 0xDF:hang=0。break。// } P1=0。 //P1全低電平 P3=0xFF。//P3全高電平 switch(P3amp。0xFF) { case 0xFE:lie=4。break。 // case 0xFD:lie=3。break。 // case 0xFB:lie=2。break。 // case 0xF7:lie=1。break。 // case 0xEF:lie=0。break。 // } P1=0xFF。 //P1全高電平 P3=0。 //P3全低電平 while(P1!=0xFF||P3!=0)。 //按鍵松開后才返回值 key=tab1[hang][lie]。 } else key=39。_39。 return (key)。 }/************************************************************************/** 主函數(shù)/** /** /*************************************************************************/void main(void){ uchar hz_Num。 //用于計當(dāng)前測試的是第幾個詞,第一個為0 uchar temp[8]。 //用于送液晶屏顯示的臨時變量 uchar iword=0,Nword=0。 //輸入單詞字母下一個計數(shù) LCD12864_init()。 //LCD12864初始化 ClearLCD()。 //清屏 en_disp(2,1,11,Asc,INPUT WORD:,1)。 //在第2行 第1列 en_disp(4,1,1,Asc,1)。 //在第5行,第2列開始顯示 en_disp(6,0,8,Asc,correct:,1)。 //在第7行,第1列開始顯示 en_disp(6,80,5,Asc,00/10,1)。 //在第7行 第81列 P1=0xFF。 //P1全高電平 P3=0。 //P3全低電平 while(1) { KeyNum[iword]=kbscan()。 //掃描鍵盤的輸入值,沒按下時返回下橫線 hz_disp(0,48,1,hz1+hz_Num*32,1)。 //在第1行,第49列開始顯示測試的漢字 temp[0]=(hz_Num+1)/10+0x30。 //將十進制數(shù)轉(zhuǎn)換為ASCII字符 temp[1]=(hz_Num+1)%10+0x30。 //算出測試漢字的序號的第一位和第二位 en_disp(0,20,1,Asc,:,1)。 //在第1行 第21列 en_disp(0,4,2,Asc,temp,1)。 //在第1行 第5列 顯示測試序號 if(KeyNum[iword]!=39。_39。) //鍵盤有按鍵按下 { if(KeyNum[iword]==1) //如果按下了確定鍵 { if(SL[hz_Num]==iwordamp。amp。verify) //輸入長度等于測試單詞的長度,則正確 ,verify表示按下了確認(rèn)后有效一次 { correctNUM+=1。 if(correctNUM10) { correctNUM=10。 //最多10個正確的 } verify=0。 //標(biāo)志位清零 hz_Num++。 //測試下一個單詞 if(hz_Num==10) hz_Num=0。 //最多設(shè)10個單詞 temp[0]=(correctNUM)/10+0x30。 //將十進制數(shù)轉(zhuǎn)換為ASCII字符 temp[1]=(correctNUM)%10+0x30。 //算出測試漢字的序號的第一位和第二位 en_disp(6,80,2,Asc,temp,1)。 //在第7行 第81列 iword=0。 Nword=0。 en_disp(4,16,8,Asc, ,1)。 //在第5行,第17列開始顯示 } } else if(KeyNum[iword]==2||KeyNum[iword]==4)//如果按下了“不認(rèn)識”或“下一個”鍵 ,直接跳到下一個單詞 { result=0。 //跳下一個時錯誤燈滅 ERROR=0。 hz_Num++。 //測試下一個單詞 if(hz_Num==10) hz_Num=0。 //最多設(shè)10個單詞 iword=0。 Nword=0。 en_disp(4,16,8,Asc, ,1)。 //在第5行,第17列開始顯示 } else if(KeyNum[iword]==3) //如果按下了“上一個”鍵 ,直接跳到上一個單詞 { result=0。 //跳下一個時錯誤燈滅 ERROR=0。 //測試下一個單詞 if(hz_Num==0) hz_Num=10。 //最多設(shè)10個單詞 hz_Num。 iword=0。 Nword=0。 en_disp(4,16,8,Asc, ,1)。 //在第4行,第16列開始顯示 } else if(S[hz_Num][iword]==KeyN
點擊復(fù)制文檔內(nèi)容
環(huán)評公示相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1