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

正文內(nèi)容

西電自動化單片機實驗報告(編輯修改稿)

2024-08-31 05:29 本頁面
 

【文章內(nèi)容簡介】 mp。 0x02) == 0) key = 39。E39。 else if((col amp。 0x04) == 0) key = 39。F39。 else if((col amp。 0x08) == 0) key = 39。039。 break。 case 1: if((col amp。 0x01) == 0) key = 39。C39。 else if((col amp。 0x02) == 0) key = 39。739。 else if((col amp。 0x04) == 0) key = 39。439。 else if((col amp。 0x08) == 0) key = 39。139。 break。 case 2: if((col amp。 0x01) == 0) key = 39。B39。 else if((col amp。 0x02) == 0) key = 39。839。 else if((col amp。 0x04) == 0) key = 39。539。 else if((col amp。 0x08) == 0) key = 39。239。 break。 case 3: if((col amp。 0x01) == 0) key = 39。A39。 else if((col amp。 0x02) == 0) key = 39。939。 else if((col amp。 0x04) == 0) key = 39。639。 else if((col amp。 0x08) == 0) key = 39。339。 break。 default: break。 } return key。}/********************************************************************// Function name : recv_key// Description : 將獲取的鍵值加入按鍵緩沖區(qū)// Return type : void// Argument : int key*********************************************************************/void recv_key(int key){ key_recv_buf[key_recv_write] = key。 key_recv_write ++。 if(key_recv_write = RECV_CMD_MAX_BUF) key_recv_write = 0。 if(key_recv_write == key_recv_read) { // 緩沖區(qū)以滿 key_recv_read ++。 if(key_recv_read = RECV_CMD_MAX_BUF) key_recv_read = 0。 }}/********************************************************************// Function name : Kbd_Scan// Description : 定時器1中斷服務(wù)程序,用于掃描鍵盤,每隔10ms一次中斷// Return type : void// Argument : void*********************************************************************/void Kbd_Scan(void){ int loopt = row, bexit = 0。 int temp。 // 鍵盤掃描 for( loopt = row。 loopt row + 4。 loopt ++) { if(loopt = 4) temp = loopt 4。 else temp = loopt。 switch(keyboard_scan_status[temp]) { case KEYBOARD_SCAN_FIRST: *keyboard_port_scan = output_0x10000000 amp。 (~(0x00000001temp))。 /*將row列置低電平 */ keyboard_scan_status[temp] = KEYBOARD_SCAN_SECOND。 bexit = 1。 break。 case KEYBOARD_SCAN_SECOND: input_key[temp] = (*keyboard_port_value) amp。 key_mask。 /*并獲取第一次掃描值*/ if(input_key[temp] == key_mask) keyboard_scan_status[temp] = KEYBOARD_SCAN_FIRST。 /* 沒有按鍵,回到開始狀態(tài) */ else { keyboard_scan_status[temp] = KEYBOARD_SCAN_THIRD。 /* 有按鍵 */ bexit = 1。 } break。 case KEYBOARD_SCAN_THIRD: if (((*keyboard_port_value) amp。 key_mask) != input_key[temp]) keyboard_scan_status[temp] = KEYBOARD_SCAN_FIRST。 else { ascii_key = key_get_char(temp, input_key[temp])。 keyboard_scan_status[temp] = KEYBOARD_SCAN_FOURTH。 *keyboard_port_scan = output_0x10000000 amp。 (~(0x00000001temp))。 /*將row列置低電平 */ bexit = 1。 } break。 case KEYBOARD_SCAN_FOURTH: input_key1[temp] = (*keyboard_port_value) amp。 key_mask。 /*并獲取第一次掃描值*/ if(input_key1[temp] == key_mask) { // get a key recv_key(ascii_key)。 keyboard_scan_status[temp] = KEYBOARD_SCAN_FIRST。 }else { *keyboard_port_scan = output_0x10000000 amp。 (~(0x00000001temp))。 /*將row列置低電平 */ bexit = 1。 } break。 } if(bexit) break。 } row = temp。 }/********************************************************************// Function name : Key_GetKey// Description : 如果有鍵按下返回鍵,否則返回0// Return type : char// Argument : *********************************************************************/char Key_GetKey(){ char ch。 if(key_recv_write == key_recv_read) { /* no key found */ ch = 0。 }else { ch = key_recv_buf[key_recv_read]。 key_recv_read ++。 if(key_recv_read = RECV_CMD_MAX_BUF) key_recv_read = 0。 } return ch。}/********************************************************************// Function name : Key_GetKeyPoll(查詢方式)// Description : 如果有鍵按下返回鍵,否則返回0// Return type : char// Argument : *********************************************************************/char Key_GetKeyPoll(){ int row。 unsigned char ascii_key, input_key, input_key1, key_mask = 0x0F。 for( row = 0。 row 4。 row++) { *keyboard_port_scan = output_0x10000000 amp。 (~(0x00000001row))。 /*將row列置低電平 */ Delay(3)。 /*延時 */ input_key = (*keyboard_port_value) amp。 key_mask。 /*并獲取第一次掃描值*/ if(input_key == key_mask) continue。 /* 沒有按鍵 */ /* 延時,再次獲取掃描值,如果兩次的值不等,則認為是一個干擾 */ Delay(3)。 if (((*keyboard_port_value) amp。 key_mask) != input_key) continue。 // 等待按鍵松開 while(1) { *keyboard_port_scan = output_0x10000000 amp。 (~(0x00000001row))。 /*將row列置低電平 */ Delay(3)。 input_key1 = (*keyboard_port_value) amp。 key_mask。 /*并獲取第一次掃描值*/ if(input_key1 == key_mask) break。 /* 沒有按鍵 */ } ascii_key = key_get_char(row, input_key)。 /* 查表 */ return ascii_key。 /* 顯示結(jié)果 */ } return 0。}實驗結(jié)果:按下鍵盤的按鍵串口會按題圖中所示對應顯示3./* 包含文件 */include include include include include include include define IIRNUMBER 2define U8 unsigned charunsigned char table[16] = { /* 0 1 2 3 4 5 6 7*/ 0xc0, 0xf9, 0xa4, 0xb0, 0x99, 0x92, 0x82, 0xf8, /* 8 9 A B C D E F*/ 0x80, 0x90, 0x88, 0x83, 0xc6, 0xa1, 0x86, 0x8e,}。/********************************************************************// Function name : Main// Description : JXARM92440 鍵盤實驗主程序// 實現(xiàn)功能:// Return type : void// Argument : void*********************************************************************/void Main(void){ /* 配置系統(tǒng)時鐘 */ ChangeClockDivider(2,1)。 U32 mpll_val = 0 。 mpll_val = (9212)|(14)|(1)。 ChangeMPllValue((mpll_val12)amp。0xff, (mpll_val4)amp。0x3f, mpll_valamp。3)。
點擊復制文檔內(nèi)容
環(huán)評公示相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1