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

正文內(nèi)容

嵌入式實(shí)驗(yàn)報(bào)告(編輯修改稿)

2025-08-30 12:27 本頁面
 

【文章內(nèi)容簡介】 八、 LCD 1602顯示2實(shí)驗(yàn)電路圖:源程序:include define rs (15)define rw (16)define en (17)define busy (115)/* 函數(shù)名稱:ChkBusy()* 函數(shù)功能:檢查總線是否忙**/void ChkBusy(){ IO0DIR=0xf0。 while(1) { IO0CLR=rs。 IO0SET=rw。 IO0SET=en。 if(!(IO0PIN amp。 busy))break。 IO0CLR=en。 } IO0DIR=0xffffffff。}/* 函數(shù)名稱:WrOp()* 函數(shù)功能:寫命令* 入口參數(shù):dat,待寫入LCD的命令 **/void WrOp(uint8 dat){ ChkBusy()。IO0CLR=rs。IO0CLR=rw。 IO0CLR=IO0CLR|0xff00。 //先清零 IO0SET=dat8。 //再送數(shù) IO0SET=en。IO0CLR=en。}/* 函數(shù)名稱:WrDat()* 函數(shù)功能:寫數(shù)據(jù)* 入口參數(shù):dat,待寫入LCD的數(shù)據(jù) **/void WrDat(uint8 dat) { ChkBusy()。IO0SET=rs。IO0CLR=rw。 IO0CLR=IO0CLR|0xff00。 //先清零 IO0SET=dat8。 //再送數(shù) IO0SET=en。IO0CLR=en。}/* 函數(shù)名稱:lcd_init()* 函數(shù)功能:lcd初始化**/void lcd_init(void){ WrOp(0x38)。WrOp(0x06)。WrOp(0x0c)。 }/* 函數(shù)名稱:DisText()* 函數(shù)功能:顯示文本* 入口參數(shù):addr LCD DDRAM地址,*p 文本指針 **/void DisText(uint8 addr,char *p){ WrOp(addr)。 while(*p !=39。\039。)WrDat(*(p++))。}/* 函數(shù)名稱:main()* 函數(shù)功能:LCD初始化,自定義漢字字符,LCD顯示英文和漢字字符。**/int main(void){ uint8 i。 lcd_init()。 // LCD初始化 DisText(0x80,lu ming yue)。 DisText(0xc0,abcdefg hijklmn)。 while(1)。}九、 LCD 1602顯示3實(shí)驗(yàn)電路圖:源程序:include define rs (15)define rw (16)define en (17)define busy (115)/* 函數(shù)名稱:ChkBusy()* 函數(shù)功能:檢查總線是否忙**/void ChkBusy(){ IO0DIR=0xf0。 while(1) { IO0CLR=rs。 IO0SET=rw。 IO0SET=en。 if(!(IO0PIN amp。 busy))break。 IO0CLR=en。 } IO0DIR=0xffffffff。}/* 函數(shù)名稱:WrOp()* 函數(shù)功能:寫命令* 入口參數(shù):dat,待寫入LCD的命令 **/void WrOp(uint8 dat){ ChkBusy()。IO0CLR=rs。IO0CLR=rw。 IO0CLR=IO0CLR|0xff00。 //先清零 IO0SET=dat8。 //再送數(shù) IO0SET=en。IO0CLR=en。}/* 函數(shù)名稱:WrDat()* 函數(shù)功能:寫數(shù)據(jù)* 入口參數(shù):dat,待寫入LCD的數(shù)據(jù) **/void WrDat(uint8 dat) { ChkBusy()。IO0SET=rs。IO0CLR=rw。 IO0CLR=IO0CLR|0xff00。 //先清零 IO0SET=dat8。 //再送數(shù) IO0SET=en。IO0CLR=en。}/* 函數(shù)名稱:lcd_init()* 函數(shù)功能:lcd初始化**/void lcd_init(void){ WrOp(0x38)。WrOp(0x06)。WrOp(0x0c)。 }/* 函數(shù)名稱:DisText()* 函數(shù)功能:顯示文本* 入口參數(shù):addr LCD DDRAM地址,*p 文本指針 **/void DisText(uint8 addr,char *p){ WrOp(addr)。 while(*p !=39。\039。)WrDat(*(p++))。}/* 函數(shù)名稱:main()* 函數(shù)功能:LCD初始化,自定義漢字字符,LCD顯示英文和漢字字符。**/int main(void){ uint8 i。 lcd_init()。 // LCD初始化 DisText(0x80,abcdefg hijklmn)。 DisText(0xc0,lu ming yue)。 while(1)。}十、 PWM脈寬調(diào)制實(shí)驗(yàn)內(nèi)容:LPC2131芯片PWM模塊可以實(shí)現(xiàn)6路單邊沿控制或者3路雙邊沿控制,或者兩者混合輸出。實(shí)驗(yàn)電路圖:源程序:include define RED_A (18)。define YELLOW_A (19)。define GREEN_A (110)。define RED_B (111)。define YELLOW_B (112)。define GREEN_B (113)。uint8 Flash_Count = 0。uint8 Operation_Type = 1。void DelayMS(uint16 x){ uint16 t。 while(x) {for(t=500。t0。t)。}}void Traffic_lignt(){ switch(Operation_Type) {case 1: IO0SET=RED_A。 IO0SET=YELLOW_A。 IO0CLR=GREEN_A。 IO0CLR=RED_B。 IO0SET=YELLOW_B。 IO0SET=GREEN_B。 DelayMS(2000)。 Operation_Type = 2。 break。 case 2: DelayMS(200)。 IO0SET=YELLOW_A。 DelayMS(200)。 IO0CLR=YELLOW_A。 IO0SET=GREEN_A。 if(++Flash_Count !=5) return。 Flash_Count=0。 Operation_Type = 3。 break。 case 3: IO0CLR=RED_A。 IO0SET=YELLOW_A。 IO0SET=GREEN_A。 IO0SET=RED_B。 IO0SET=YELLOW_B。 IO0CLR=GREEN_B。 DelayMS(2000)。 Operation_Type = 4。 break。 case 4: DelayMS(200)。 IO0SET=YELLOW_B。 DelayMS(200)。 IO0CLR=YELLOW_B。 IO0SET=GREEN_B。 if(++Flash_Count !=5) return。 Flash_Count=0。 Operation_Type = 1。 break。 }}int main(void){ PINSEL0=0x00000000。 PINSEL1=0X00000000。 IO0DIR=0x00003f00。 while(1) {Traffic_lignt()。 }} 十一、流水燈實(shí)驗(yàn)電路圖:include void DelayNS (uint32 dly){ uint32 i。 for ( 。 dly0。 dly) for (i=0。 i50000。 i++)。}int main (void){ PINSEL0 = 0x00000000。 IO0DIR = 0x000000ff。 while (1) { IO0PIN = 0xAA。 DelayNS(15)。 IO0PIN = 0x55 。 DelayNS(15)。 IO0PIN = 0x00 。 DelayNS(15)。 }}十二、模擬交通燈實(shí)驗(yàn)電路圖:源程序:include define RED_A (18)。define YELLOW_A (19)。define GREEN_A (110)。define RED_B (111)。define YELLOW_B (112)。define GREEN_B (113)。uint8 Flash_Count = 0。uint8 Operation_Type = 1。void DelayMS(uint16 x){ uint16 t。 while(x) {for(t=500。t0。t)。}}void Traffic_lignt(){ switch(Operation_Type) {case 1: IO0SET=RED_A。 IO0SET=YELLOW_A。 IO0CLR=GREEN_A。 IO0CLR=RED_B。 IO0SET=YELLOW_B。 IO0SET=GREEN_B。 DelayMS(2000)。 Operation_Type = 2。 break。 case 2: DelayMS(200)。 IO0SET=YELLOW_A。 DelayMS(200)。 IO0CLR=YELLOW_A。 IO0SET=GREEN_A。 if(++Flash_Count !=5) return。 Flash_Count=0。 Operation_Type = 3。 break。 case 3: IO0CLR=RED_A。 IO0SET=YELLOW_A。 IO0SET=GREEN_A。 IO0SET=RED_B。 IO0SET=YELLOW_B。 IO0CLR=GREEN_B。 DelayMS(2000)。 Operation_Type = 4。 break。 case 4: DelayMS(200)。 IO0SET=YELLOW_B。 DelayMS(200)。 IO0CLR=YELLOW_B。 IO0SET=GREEN_B。 if(++Flash_Count !=5) return。 Flash_Count=0。 Operation_Type = 1。 break。 }}int main(void){ PINSEL0=0x00000000。 PINSEL1=0X00000000。 IO0DIR=0x00003f00。 while(1) {Traffic_lignt()。 }}十三、FIQ中斷服務(wù)實(shí)驗(yàn)電路圖:include define LED1 1 18 define EINT0 14 int main (void){ PINSEL1 = 0x00000001。 IO0DIR = LED1。 EXTMODE = 0x00。 FIQEnable()。 VICIntSelect = 1 EINT0。 EXTINT = 0x01。 VICIntEnable = 1 EINT0。 while (1)。 }void FIQ_Exception(void){ uint32 i。 i = IO0SET。 if ((i amp。 LED1) == 0) IO0SET = LED1。 else IO0CLR = LED1。 while ((EXTINT amp。 0x01) != 0) { EXTINT = 0x01。 }}十四、按鍵控制LED實(shí)驗(yàn)內(nèi)容:每一按鍵對應(yīng)一個(gè)LED燈,當(dāng)按鍵被按下,對應(yīng)的LED燈亮;實(shí)驗(yàn)電路圖:include include void DelayNS(uint32 dly){ uint32 i。 for(。 dly0。 dly) for(i=0。 i50000。 i
點(diǎn)擊復(fù)制文檔內(nèi)容
環(huán)評公示相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1