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

正文內(nèi)容

二相步進電機控制系統(tǒng)的設(shè)計-資料下載頁

2025-07-07 12:24本頁面
  

【正文】 0x21,0x25,0x24,0x26}, {0x14,0x11,0x18,0x12},{0x14,0x15,0x11,0x19,0x18,0x1a,0x12,0x16}}。//定義電機四八拍正反轉(zhuǎn)控制字unsigned char scan[4]={0Xf7,0Xfb,0Xfd,0Xfe}。/*選擇掃描顯示數(shù)碼管,送PE口選數(shù)碼管*/unsigned char seven_seg[10]={0X3f,0X06,0X5b,0X4f,0X66,0X6d,0X7d,0X07,0X7f,0X6f}。 /*09的字符表,送PF口顯示*/unsigned char flag,pai,tt,i,key,k=0。//定義正反轉(zhuǎn),模式,拍數(shù),按鍵值,數(shù)碼管選位typedef struct{ char baiqian。 char geshi。 }conut。 //定義計數(shù)變量conut now。void port_init(void)//端口初始化程序{ PORTA = 0xFF。 DDRA = 0x00。 PORTB = 0xFF。 DDRB = 0x00。 PORTC = 0x00。 //m103 output only DDRC = 0x00。 PORTD = 0x00。 DDRD = 0xFF。 PORTE = 0x00。 DDRE = 0xFF。 PORTF = 0x00。 DDRF = 0xFF。 PORTG = 0x00。 DDRG = 0x00。}//TIMER0 initialize prescale:256// WGM: CTC// desired value: 100Hz// actual value: (%)void timer0_init(void)//定時器0初始化{ TCCR0 = 0x00。 //stop ASSR = 0x00。 //set async mode TCNT0 = 0x64。 //set count OCR0 = 0x9C。 //start timer}unsigned char timer0=0。pragma interrupt_handler timer0_p_isr:16void timer0_p_isr(void){ //pare occured TCNT0=OCR0 TCNT0 = 0x64。 OCR0 = 0x9C。 timer0++。 if(timer0==50) { timer0=0。 i++。 PORTF=d4[flag+pai][i%tt]。 if(i==100) i=0。 }}//TIMER2 initialize prescale:256// WGM: Normal// desired value: 100Hz// actual value: (%)void timer2_init(void)//定時器2初始化{ TCCR2 = 0x00。 //stop TCNT2 = 0x64。 //setup OCR2 = 0x9C。 //start}unsigned char timer2=0。pragma interrupt_handler timer2_p_isr:10void timer2_p_isr(void)//實現(xiàn)4位數(shù)碼管的計數(shù)功能{ //pare occured TCNT2=OCR2 TCNT2 = 0x64。 //setup OCR2 = 0x9C。 timer2++。 if(timer2==50) { timer2=0。 ++。 if(==99) {=0。 ++。 if(==99) =0。} } }//call this routine to initialize all peripheralsvoid init_devices(void)//單片機初始化{ //stop errant interrupts until set up CLI()。 //disable all interrupts XDIV = 0x00。 //xtal divider XMCRA = 0x00。 //external memory port_init()。 timer0_init()。 timer2_init()。 MCUCR = 0x00。 EICRA = 0x00。 //extended ext ints EICRB = 0x00。 //extended ext ints EIMSK = 0x00。 TIMSK = 0x82。 //timer interrupt sources ETIMSK = 0x00。 //extended timer interrupt sources SEI()。 //reenable interrupts //all peripherals are now initialized}void display(void)//實現(xiàn)數(shù)碼管數(shù)值的顯示{ saomiao()。 PORTE=scan[k]。 switch(k) { case 0 : PORTD=seven_seg[%10]。 break。 case 1 : PORTD=seven_seg[]。 break。 case 2 : PORTD=seven_seg[%10]。 break。 case 3 : PORTD=seven_seg[]。 break。 } k++。 if(k==4) k=0。 delay(20000,20000)。 key=PINB。 if(key==0xFF) TCCR2 = 0x00。}void delay(int d1,int d2) /*延時子函數(shù)*/ { unsigned char i,j。 i=d1。 while(i) { j=d2。 while(j)。 } }unsigned char j。saomiao()//讀取按鍵值選擇相應(yīng)的操作{key=PINB。if(key==0xFD){j=PINA。if(j==0x7F){flag=0。}else if(j==0xFF) { flag=2。}{ if(j==0xFE| j==0x7E) {TCCR0 = 0x0E。pai=0。tt=4。TCCR2 = 0x04。=00,=00。} else if(j==0xFB | j==0x7B) {TCCR0 = 0x0E。pai=1。tt=8。TCCR2 = 0x04。=00,=00。}} } else PORTF=0x80。 }void main(void){ =00,=00。init_devices()。while(1){display()。}
點擊復(fù)制文檔內(nèi)容
語文相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1