ዝርዝር ሁኔታ:

ሮክ: 8 ደረጃዎች
ሮክ: 8 ደረጃዎች

ቪዲዮ: ሮክ: 8 ደረጃዎች

ቪዲዮ: ሮክ: 8 ደረጃዎች
ቪዲዮ: የጥናት ፍላጎትን የሚጨምሩ 8 ዘዴዎች 2024, ህዳር
Anonim
ሮክ
ሮክ

ይህ ሮቦት በእይታ መሰረታዊ መርሃ ግብር (በተከታዩ ወደብ በኩል) ቁጥጥር ይደረግበታል ፣ እና በፒአይሲ ማይክሮ መቆጣጠሪያ (16F877) የመነጨው በ pulse width modulated (PWM) ምልክት በሦስት የተለያዩ ፍጥነቶች ውስጥ መንቀሳቀስ ይችላል። ሮቦቱ በሁለት ሁነታዎች “መደበኛ ቁጥጥር” እና “ቀላል መከታተያ” ሁነታዎች ሊሠራ ይችላል። በመደበኛ የመቆጣጠሪያ ሞድ ውስጥ ፣ ሮቦቱ ከ 150 - 3 ሜትር ርቀት ላይ ከ 3 - 18 ሴ.ሜ ስፋት ያላቸውን ዕቃዎች መሸከም ይችላል። በብርሃን መከታተያ ሞድ ውስጥ ፣ በጨለማ ክፍል ውስጥ ብርሃንን ይከተላል። ብዙ ዳሳሾች እንደ ብርሃን ዳሳሾች ጥቅም ላይ ውለዋል። ያጋደለ ዳሳሽ ፣ የማቆሚያ የአሁኑ ዳሰሳ ፣ የባትሪ ደረጃ ዳሰሳ ፣ እና በእጅ የሚጠቀሙ የተወሰኑ የመቀየሪያ እና የመዳሰሻ ዳሳሾች። ኮረብታ ላይ (ሲወዛወዝ) ሲሄድ እና ጨለማ ሲጨልም በራስ -ሰር መብራቱን ያበራል። እንዲሁም የአይሲን ደህንነት ለመጠበቅ ፣ ሲጣበቅ የአሁኑን ያቋርጣል እና አንድ ነገር ሲይዝ እጅ ያቆማል ።4 የዲሲ ሞተሮች በፒአይሲ ማይክሮ መቆጣጠሪያ 16F877 እና 3 የሞተር ሾፌር ወረዳዎች ቁጥጥር ስር ውለዋል። ወደ 4 ወራት ገደማ ወስዶ 600 ዶላር ገደማ ያስከፍላል።

ደረጃ 1: ፕሮጀክቱን ዲዛይን ያድርጉ

ፕሮጀክቱን ዲዛይን ያድርጉ
ፕሮጀክቱን ዲዛይን ያድርጉ
ፕሮጀክቱን ዲዛይን ያድርጉ
ፕሮጀክቱን ዲዛይን ያድርጉ

በመነሻ ደረጃው የፕሮጀክቱ ንድፍ ቀርቧል። በዋናነት ፣ የማገጃውን ዲያግራም መግለፅ ፤ ስዕሉን ይመልከቱ።

በዚህ ደረጃ የበለጠ ዝርዝር የወረዳ ዲያግራም ያስፈልጋል ፣ ሆኖም ፣ ይህንን ለማመቻቸት ፣ ዋናዎቹ ሞጁሎች ተለይተዋል - 1. ማይክሮ መቆጣጠሪያ 2. ዳሳሾች 3. ሞተሮች 4. ሽቦ አልባ ወረዳ 5. ፒሲ ፕሮግራም። የ 3 ዲ ዲዛይን እንዲሁ ተከናውኗል ፣ ስዕሉን ይመልከቱ።

ደረጃ 2 መሣሪያዎቹን እና አካላትን ይምረጡ

በዚህ ደረጃ ንድፍ አውጪው ሮቦትን ለመገንባት የሚያስፈልጉትን መሣሪያዎች እና አካላት መምረጥ አለበት።

ይህ የሚከተሉትን ያጠቃልላል-ሽቦ አልባው ወረዳ (MAX232 ፣ LM331 ፣ ኤፍኤም አስተላላፊ እና ተቀባዩ ሞጁሎች) ፣ ሞተሮች (4 ዲሲ ሞተሮች) ፣ የሞተር ሾፌሮች ወረዳ (ኤች-ድልድይ) ፣ የማይክሮ መቆጣጠሪያ PIC (16F877) ፣ ባትሪ ፣ የቮልቴጅ ተቆጣጣሪዎች (MC7805) ፣ ማይክሮስዊች ፣ ፎቶቶሪስተርስ ፣ ዘንበል ዳሳሽ… ወዘተ የእነዚህን መሣሪያዎች ስሌት እና እንዴት አብረው እንደሚሠሩ መረዳት አስፈላጊ ነው።

ደረጃ 3 ማይክሮ መቆጣጠሪያ

ማይክሮ መቆጣጠሪያ
ማይክሮ መቆጣጠሪያ

ይህ እርምጃ በጣም አስፈላጊው እርምጃ ነው። መጀመሪያ ላይ ከፒአይሲ (ፒሲአይ) የሚቀበሉ እና የሚተላለፉ ኮዶች ተለይተው መታወቅ አለባቸው።

ክፍሎቹን ከተገቢው የፒአይፒ ፒኖች ጋር ማገናኘት ይጀምሩ እና ማይክሮ መቆጣጠሪያውን ያቅዱ። ይህ ተቆጣጣሪዎችን ፣ ተከላካዮችን ፣ ዳሳሾችን… ወዘተ በመጠቀም አነስተኛ ወረዳዎችን መገንባት ሊያስፈልግ ይችላል።

ደረጃ 4 የፒሲ ፕሮግራሙን ይፃፉ

የፒሲ ፕሮግራሙን ይፃፉ
የፒሲ ፕሮግራሙን ይፃፉ
የፒሲ ፕሮግራሙን ይፃፉ
የፒሲ ፕሮግራሙን ይፃፉ

ፕሮግራሙ የተጻፈው በምስል መሠረታዊ ላይ ነው።

ግንኙነቱ የተቋቋመው በ RS-232 በኩል ነው። ቅንብሮቹን በማዋቀር (የወደብ ቁጥር ፣ የባውድ ተመን ፣ የእኩልነት የውሂብ ቢቶች ፣ የማቆሚያ ቢቶች) በማዋቀር MSComm ን በመጠቀም መረጃውን ወደ ማይክሮ መቆጣጠሪያው ለመላክ። በአንድ ማቆሚያ ቢት እና እኩልነት ባለ 8 ቢት መረጃን በባውድ መጠን 9600 bps እጠቀም ነበር።

ደረጃ 5 አካልን ይገንቡ

አካልን ይገንቡ
አካልን ይገንቡ
አካልን ይገንቡ
አካልን ይገንቡ

የሰውነት ጥሩ ንድፍ አስፈላጊ ነው። እንዲሁም የመንኮራኩሩን ዝግጅት መምረጥ ፣ ስዕሉን ይመልከቱ።

ሮቦቱ የተገነባው ፕሮግራሞቹ በጥሩ ሁኔታ እየሠሩ መሆናቸውን ካረጋገጠ በኋላ ነው። ይህ እርምጃ ከፕሮግራሙ በፊትም ሊከናወን ይችላል።

ደረጃ 6 የገመድ አልባ ወረዳውን ይገንቡ

ሽቦ -አልባ ወረዳውን ይገንቡ
ሽቦ -አልባ ወረዳውን ይገንቡ

የገመድ አልባ ወረዳውን መገንባት ገለልተኛ ሊሆን ይችላል። በመነሻ ደረጃው ፒሲውን ከሮቦት ጋር ለማገናኘት ሽቦ ተጠቅሜያለሁ ፣ እና ሮቦቱን ከጨረሰ በኋላ ሽቦ አልባው ወረዳ ተቀናጅቷል።

ደረጃ 7 - ማዋሃድ

ውህደት
ውህደት

ክፍሎቻችንን ያዋሃድንበት እና ሮቦቱን የፈተንነው ይህ ቅጽበት ነው።

ደረጃ 8 የማይክሮ መቆጣጠሪያ ፕሮግራም ኮድ

; *************** የመጨረሻ ************************************ ዝርዝር p = 16f877 ራዲክስ ዲክሎክ "ቪ" << 8 | "1"; የስሪት ቁጥርconconig _CP_OFF & _PWRTE_OFF & _WDT_OFF & _XT_OSC ፤ ********** ዋና ተለዋዋጭ *************************** cblock 0x20; ባንክ 0 ራም አካባቢ INPUT_VAR L1 L2 X SPEED11 SPEED12 SPEED21 SPEED22 MSTOP LDET LR1 LR2 endc ፤ ********** የዋናው ፕሮግራም ጅምር *************** BSF ን ይጀምሩ STATUS ፣ RP0 BCF STATUS ፣ RP1 MOVLW 0X40 MOVWF ADCON1 MOVLW 0XFF ፤ ፖርት ኤ አይ MOVWF TRISA MOVLW 0X00 ፤ ፖርት ቢ ነው MOVWF TRISB MOVLW 0XF0 ፤ PORT C I I/O MOVWF TRISC TRISD MOVLW 0X07; ፖርት ኢ እኔ MOVWF ትሪዝ ባንክ ተቀማጭ አማራጭ_REG BCF OPTION_REG ፣ T0CS BCF STATUS ፣ RP1 BCF STATUS ፣ RP0 ፤ ************************* ******************; ******************************* ***** ፖርትቢ ፣ 7 MOVLW 0X00 MOVF MSTOP MOVF LDET BANKSEL INTCON BCF INTCON ፣ GIE BANKSEL TXSTA BSF TXSTA ፣ BRGH MOVLW 0X40 MOVWF SPBRG BCF TXSTA ፣ SYNC BANKSEL RCSTA BSF RCSTA RCSTA RCSTA RCSTA RCSTA RCSTA RCSTA RCSTA ፣ OERR GOTO CLROE BANKSEL PIE1 BSF PIE1 ፣ RCIE BANKSEL RCSTA BCF RCSTA ፣ RX9 BSF RCSTA ፣ CRENWAIT1 BANKSEL PORTB BSF PORTB ፣ 3 BSF PORTB ፣ 4 BANKSEL PIRT BTFBFFFBF ፣ BFFSBFFBF CW PWM1OFF CALL PWM2OFF CALL DARKLIGHT BTFSC LDET ፣ 0 BSF PORTB ፣ 7RXDATA ፣ BANKSEL RCSTA ፤ BTFSC RCSTA ፣ OERR ፤ GOTO STOPS CALL PWM1OFF CALL PWM2OFF CALL DARKLIGHF 0; *******************************************; **** ******************************************* MOVWF INPUT_VAR MOVLW 0X00 MOVWF RCREG BCF STATUS ፣ RP0 BCF STATUS ፣ RP1 MOVF INPUT_VAR ፣ 0 ፤ SUBLW 0X53 BTFSC STATUS ፣ Z GOTO STOPS MOVF INPUT_VAR ፣ 0; በ SUBLW 0X4E BTFSC STATUS ፣ Z GOTO LON MOVF INPUT_VAR, 0; 0; MOVE FORWARD SLOW SUBLW 0X66 BTFSC STATUS ፣ Z GOTO FSLOW MOVF INPUT_VAR ፣ 0; MOVE RIGHT SLOW SUBLW 0X72 BTFSC STATUS ፣ Z GOTO RSLOW MOVF INPUT_VAR ፣ 0; MOVE LEFT SLOW SUBLW 0 X6C BTFSC STATUS ፣ Z GOTO LSLOW MOVF INPUT_VAR ፣ 0; የኋላ ጀርባ SLOW SUBLW 0X62 BTFSC STATUS ፣ Z GOTO BSLOW MOVF INPUT_VAR ፣ 0; FORWARD MEDIUM SUBLW 0X4VMUVTMUVTUBMSTV ፣ 0X4MSTV ፣ 0X46BTUFMTST ፣ 0X46 BTFSC STATUS ፣ Z GOTO RMED MOVF INPUT_VAR ፣ 0; LEFT MEDIUM SUBLW 0X4C BTFSC STATUS ን ፣ Z GOTO LMED MOVF INPUT_VAR ፣ 0; MOVE BACKWARD MEDIUM SUBLW 0X42 BTFSC STATUS ፣ Z GOTO BMF ፣ Z GOTO BMF Z GOTO FFAST MOVF INPUT_VAR ፣ 0 ፤ RIGHT FAST SUBLW 0X57 BTFSC STATUS ን ፣ Z GOTO RFAST MOVF INPUT_VAR ፣ 0; የግራ ፈጣኑን SUBLW 0X56 BTFSC STATUS ፣ Z GOTO LFAST MOVF INPUT_VARAR ፣ F58WUF ፣ F58WUF ፣ FUTSVWUF ፣ FUTSVVUF ፣ MOVF INUT_VARAR BFAST MOVF INPUT_VAR ፣ 0; HAND CLOSE SUBLW 0X43 BTFSC STATUS ፣ Z GOTO HCLOSE MOVF INPUT_VAR ፣ 0; HAND OPEN SUBLW 0X4F BTFSC STATUS ፣ Z GOTO HOPEN MOVF INPUT_VAR ፣ 0; HAND UP SUBLW ፣ 0F HAND DOWN SUBLW 0X64 BTFSC STATUS ፣ Z GOTO HDOWN MOVF INPUT_VAR ፣ 0 ፤ ቀላል ብርሃን ይከተሉ አር SUBLW 0X54 BTFSC STATUS ፣ Z GOTO LFOLLOW ፤ *************************************** ***; ******************************************* GOTO CLROEFSLOW; BANKSEL RCSTA; BCF RCSTA, OERR; LDET ፣ 0;, RCIF GOTO RXDATA GOTO REP3 GOTO CLROE; ***************************************** ** LSLOW BCF STATUS ፣ RP0 BCF STATUS ፣ RP1 ፤ ጥሪ BUTTLEVEL ፤ BTFSC MSTOP ፣ 1 ፤ GOTO STOPS MOVLW 0X00 MOVWF MSTOP BCF LDET ፣ 0 CALL DARKLIGHT BTFSC LDET ፣ 0; BSF PFTWWF ፣ MOVFFWWF ፣ MOVFFWWF ፣ MOVFFWWF 0XCF MOVWF SPEED21 MOVLW 0X66 MOVWF SPEED22 CALL PWM1ON CALL PWM2ON BSF PORTD ፣ 0 BCF PORTD ፣ 1 BSF PORTB ፣ 1 BCF POR ቲቢ ፣ 2 REP4 BANKSEL PIR1 BTFSC PIR1 ፣ RCIF GOTO RXDATA GOTO REP4 GOTO CLROE ፤ ******************************* ***** 0XCF MOVWF SPEED11 MOVLW 0X66 MOVWF SPEED12 MOVLW 0XFF MOVWF SPEED21 MOVLW 0X99 MOVWF SPEED22 CALL PWM1ON CALL PWM2ON BCF PORTD ፣ 0 BSF PORTD ፣ 1 BCF PORRB, PBRBB PRT, 1 BF PORT, 1 BF ***** MSTOP ፣ 1; GOTO STOPS CALL DARKLIGHT BTFSC LDET ፣ 0; BSF PORTB ፣ 7 MOVLW 0XCF MOVWF SPEED11 MOVLW 0X99 MOVWF SPEED12 MOVLW 0XCF MOVWF SPEED21 MOVLW 0XFMFFMFFMFFMFFMFFMFFMFFMFFMFFMFFMFFMFFMFFMFMFFMMFFMFFMMFFMFFMFFMFFMMFFMMFFMMFFMFFMUFMFFMFFMFMFMFMMFFMMFMFMMFMFMMMFMFMFMFMMFMMFMMMFFMMHMUHMUFMHMMFMHMMFFMMFMMMFFMMFFMMFFMMF gị MADIQI MEDFTIME 1 PORTB ፣ 2 REP5 BANKSEL PIR1 BTFSC PIR1 ፣ RCIF GOTO RXDATA GOTO REP5 GOTO CLROE ፤ ******************************* ********** ኤፍ MED BCF STATUS ፣ RP0 BCF STATUS ፣ RP1 MOVLW 0X00 MOVWF MSTOP BCF LDET ፣ 0; የጥሪ ቡትሌቬል ፣ BTFSC MSTOP ፣ 1; MOVWF SPEED21 MOVLW 0X99 MOVWF SPEED22 CALL PWM1ON CALL PWM2ON BCF PORTD ፣ 0 BCF PORTD ፣ 1 BSF PORTB ፣ 1 BSF PORTB ፣ 2 CALL SDELAY REP6 CALL STALL1 BTFSC MSTOP ፣ 0 GOTO STOPS, 0 GOTO STOPS GOTO REP6 PLUSEMED MOVLW 0XCF MOVWF SPEED11 MOVLW 0XCC MOVWF SPEED12 MOVLW 0XCF MOVWF SPEED21 MOVLW 0XCC MOVWF SPEED22 CALL PWM1ON CALL PWM2ON BCF PORTD, 0 BCF PORTD, 0 BCF PORTD, 0 BCF PORTD, 0 BCF PORTD, 0 BCF PORTD, 0 BCF PORTD, 0 BCF PORTD, 0 BCF PORTD BANKSEL PIR1 BTFSC PIR1 ፣ RCIF GOTO RXDATA BTFSS PORTD ፣ 7 GOTO NORMALMED GOTO REP7 GOTO CLROE ፤ ******************************* ************ RMED BCF STATUS ፣ RP0 BCF STATUS ፣ RP1 MOVLW 0X00 MOVWF MSTOP BCF LDET ፣ 0 ፤ የጥሪ ቡትሌቬል ፣ BTFSC MSTOP ፣ 1; GOTO STOPS CALL DARKLIGHT BTFSC LDET ፣ 0; BSF PORT ለ ፣ 7 MOVLW 0XFF MOVWF SPEED11 MOVLW 0X99 MOVWF SPEED12 MOVLW 0XFF MOVWF SPEED21 MOVLW 0X66 MOVWF SPEED22 CALL PWM1ON CALL PWM2ON BCF PORTD ፣ 0 BSF PORT ፣ 1 BCF PORT ፣ 1 BCF PORT ፣ 1 BCF PORT ፣ 1 BCF BTFSC PIR1 ፣ RCIF GOTO RXDATA GOTO REP8 GOTO CLROE ፤ *************************************** **** LMED BCF STATUS ፣ RP0 BCF STATUS ፣ RP1 MOVLW 0X00 MOVWF MSTOP BCF LDET ፣ 0 ፤ የጥሪ ቡትሌቨል ፣ BTFSC MSTOP ፣ 1; GOTO STOPS CALL DARKLIGHT BTFSC LDET, 0; SPEED12 MOVLW 0XFF MOVWF SPEED21 MOVLW 0X99 MOVWF SPEED22 CALL PWM1ON CALL PWM2ON BSF PORTD ፣ 0 BCF PORTD ፣ 1 BSF PORTB ፣ 1 BCF PORTB ፣ 2 REP9; CALL STALL1 ፣ BTFSC MST ፣ BTFSC MST REP9 GOTO CLROE; ******************************************* ቢሜድ ቢሲፍ ሁኔታ ፣ RP0 BCF STATUS ፣ RP1 MOVLW 0X00 MOVWF MSTOP BCF LDET ፣ 0; የጥሪ ቡትሌቬል ፣ BTFSC MSTOP ፣ 1; GOTO CALL DARKLIGHT BTFSC LDET ፣ 0; MOVLW 0X7F MOVWF SPEED12 MOVLW 0XFF MOVWF SPEED21 MOVLW 0X7F MOVWF SPEED22 CALL PWM1ON CALL PWM2ON BSF PORTD ፣ 0 BSF PORTD ፣ 1 BCF PORTB ፣ 1 BCF PORT GOT ፣ ROT POTSBT, POTBOTS, POTT, BRF STOB, POTT, POTS, POTT, POTT, BRF, POTT, POTT, BRF, POTBB, POTT, BRF, POTT, POTBB, POTB, POTBB, POTB, POTBB REP10 GOTO CLROE; ፣ RP0 BCF STATUS ፣ RP1 MOVLW 0X00 MOVWF MSTOP BCF LDET ፣ 0 BSF MSTOP ፣ 4 ፤ የጥሪ ቡትሌቬል ፣ BTFSC MSTOP ፣ 1; MOVWF SPEED21 MOVLW 0X7F MOVWF SPEED22 ጥሪ PWM1ON ጥሪ PWM2ON BCF PORTD, 0 BCF PORTD, 1 BSF PORTB, 1 BSF PORTB, 2 ጥሪ SDELAY NORMALFAST MOVLW 0XCF MOVWF SPEED11 MOVLW 0XCC MOVWF SPEED12 MOVLW 0XCF MOVWF SPEED21 MOVLW 0XCC MOVWF SPEED22 ጥሪ PWM1ON ጥሪ PWM2ON BCF PORTD ፣ 0 BCF PORTD ፣ 1 BTFSC LDET ፣ 0 BSF PORTB ፣ 7 BSF PORTB ፣ 1 BSF PORTB ፣ 2 REP11 CALL STALL1 BTFSC MSTOP ፣ 0 GOTO BANKSEL PIR1 BTFSC PIR1 ፣ RCIF GOTO RXDATA NOPS ትብብ MOVLW 0XCF MOVWF SPEED11 MOVLW 0XFF MOVWF SPEED12 MOVLW 0XCF MOVWF SPEED21 MOVLW 0XFF MOVWF SPEED22 ጥሪ PWM1ON ጥሪ PWM2ON BCF PORTD, 0 BCF PORTD, 1 BSF PORTB, 1 BSF PORTB, 2 REP12 ጥሪ STALL1 BTFSC MSTOP, 0 Goto ማቆሚያዎች BANKSEL PIR1 BTFSC PIR1 ፣ RCIF GOTO RXDATA BTFSS PORTD ፣ 7 GOTO NORMALFAST GOTO REP12 GOTO CLROE ፤ *********************************** ******** RFAST BCF STATUS ፣ RP0 BCF STATUS ፣ RP1 MOVLW 0X00 MOVWF MSTOP BCF LDET ፣ 0; የጥሪ ቡትሌቨል ፣ BTFSC MSTOP ፣ 1; GOTO STOPS CALL DARKLIGHT BTFSC LDET ፣ 0; SPEED11 MOVLW 0X99 MOVWF SPEED12 MOVLW 0XFF MOVWF SPEED21 MOVLW 0X66 MOVWF SPEED22 CALL PWM1ON CALL PWM2ON BCF PORTD ፣ 0 BSF PORTD ፣ 1 BCF PORTB ፣ 1 BSF PORTBT, BSF POT, RSBT POTT, BSF PORTB, RSBT POTT, BSF PORTB, POTSBRT POTT, BSF PORTB, BSF PORTB, RSBT POTT, BSF PORTB GOTO REP13 GOTO CLROE ፤ ******************************************************* STATUS ፣ RP0 BCF STATUS ፣ RP1 MOVLW 0X00 MOVWF MSTOP BCF LDET ፣ 0 ፤ የጥሪ ቡትሌቬል ፣ BTFSC MSTOP ፣ 1; GOTO STOPS CALL DARKLIGHT BTFSC LDET ፣ 0; BSF PORTB, 7 MOVLW 0XFF MOVWF SPEED11 MOVLW 0X66 MOVWF SPEED12 MOVLW 0XFF MOVWF SPEED21 MOVLW 0X99 MOVWF SPEED22 ጥሪ PWM1ON ጥሪ PWM2ON BSF PORTD, 0 BCF PORTD, 1 BSF PORTB, 1 BCF PORTB, 2 ጥሪ SDELAY MOVLW 0XFF MOVWF SPEED11 MOVLW 0X4C MOVWF SPEED12 MOVLW 0XEF MOVWF SPEED21 MOVLW 0XB3 MOVWF SPEED22 CALL PWM1ON CALL PWM2ON BSF PORTD ፣ 0 BCF PORTD ፣ 1 BSF PORTB ፣ 1 BCF PORTB ፣ 2 REP14 CALL STALL1 BTFSC MSTOP ፣ 0 GOTO POTO GOTO GOTO STOPS ****************************************** BFAST BCF STATUS ፣ RP0 BCF STATUS ፣ RP1 MOVLW 0X00 MOVWF MSTOP BCF LDET ፣ 0 ፤ የጥሪ ቡትቴልኤል ፣ BTFSC MSTOP ፣ 1 ፤ GOTO STOPS CALL DARKLIGHT BTFSC LDET ፣ 0; BSF PORTB ፣ 7 MOVLW 0XDF MOVWF SP21 MOVLW MOVLW MOVLW MOVLW 0 MOVLWMFF MOVLW 0FMVFF MOVLW 0MVWWFFF PWM2ON BSF PORTD ፣ 0 BSF PORTD ፣ 1 BCF PORTB ፣ 1 BCF PORTB ፣ 2 CALL SDELAY MOVLW 0XEF MOVWF SPEED11 MOVLW 0X66 MOVWF SPEED12 MOVLW 0XEF MOVWF SPEED21 MOVLWMWWWMFWMFWMFWMFWMFWMFWMFWM0WMWWWMXWWMXWMWWWMXWMWWWMXWMFWM0WMWWWWMXWMWWWMXWMWWWMXWWMXWWMXWWMXWMFWMFWMFWMFWMFWMFFMFFMFFMFMFWMFWMFWMFWMFWMFWMFFMFFMMFWMFWMFFFMFMFMFMFFMFFMFFMFFMFFMFFMFFMFFMFFMFTUFMFFMU PORTD ፣ 0 BSF PORTD ፣ 1 BCF PORTB ፣ 1 BCF PORTB ፣ 2 REP15 CALL STALL1 BTFSC MSTOP ፣ 0 GOTO BANKSEL PIR1 BTFSC PIR1 ፣ RCIF GOTO RXDATA GOTO REP15 GOTO CLROE ፤ ************* ****************************** HCLOSE BCF STATUS ፣ RP0 BCF STATUS ፣ RP1 MOVLW 0X00 MOVWF MSTOP BCF LDET ፣ 0 ፤ ጥሪ BUTTLEVEL BTFSC MSTOP ፣ 1; GOTO STOPS CALL DARKLIGHT BTFSC LDET ፣ 0; BSF PORTB ፣ 7 BTFSC PORTD ፣ 5 GOTO STOPS BTFSC PORTD ፣ 6 GOTO STS BSF PORTD ፣ 2 BCF PORTD ፣ 3 REP16 BTFSC PORT GOTO STOPS CALL SDELAY CALL STALL2 BTFSC MSTOP ፣ 2 GOTO STANPS BANKSEL PIR1 BTFSC PIR1 ፣ RCIF GOTO RXDATA GOTO REP16 GOTO CLROE ፤ ************************* ****************** HOPEN BCF STATUS ፣ RP0 BCF STATUS ፣ RP1 MOVLW 0X00 MOVWF MSTOP BCF LDET ፣ 0 ፤ የጥሪ ቡትሌቬል ፣ BTFSC MSTOP ፣ 1; GOTO CALL DARKLIGHT BTFSC LDET 0; GOTO CLROE; *********************************************** HUP BCF STATUS, RP0 BCF STATUS ፣ RP1 MOVLW 0X00 MOVWF MSTOP BCF LDET ፣ 0 ፤ የጥሪ ቡትሌቬል ፣ BTFSC MSTOP ፣ 1; GOTO STOPS CALL DARKLIGHT BTFSC LDET ፣ 0; BTFSC PORTC ፣ 4 GOTO BANKSEL PIR1 BTFSC PIR1 ፣ RCIF GOTO RXDATA GOTO REP18 GOTO CLROE ፤ *************************** ************ HDOWN BCF STATUS ፣ RP0 BCF STATUS ፣ RP1 MOVLW 0X00 MOVWF MSTOP BCF LDET ፣ 0; የጥሪ ቡትሌቨል ፣ BTFSC MSTOP ፣ 1; GOTO STOPS CALL DARKLIGHT BTFSC LDET ፣ 0; BSF PORTB ፣ 7 BTFSC PORTC ፣ 5 GOTO STS BSF PORTC ፣ 0 BCF PORTC ፣ 3 REP19 BTFSC PORTC ፣ 5 GOTO BANKSEL PIR1 BTFSC PIR1 ፣ RCIF GOTO RXDATA GOTO REP19 GOTO CLROE ፤ *************** ***** ********************************* LOFF BCF PORTB ፣ 7 BCF LDET ፣ 0 GOTO CLROE ፤ ***** ************************************** BCF STATUS ፣ RP0 BCF STATUS ፣ RP1 BCF PORTB ፣ 1 BCF PORTB ፣ 2 BCF PORTB ፣ 6 BCF PORTB ፣ 7 CALL PWM1OFF CALL PWM2OFF BCF PORTD ፣ 0 BCF PORTD ፣ 1 BCF PORTD ፣ 2 BCF PORTD ፣ 3 BSF MSTOP ፣ 6 REPLF ፤ የባንክ አማራጭ / ሬጌ ፤ BSF አማራጭ_ሬጌ ፣ 3 ፤ የ BSF አማራጭ 3 ፣ ውሳኔ 3 ፣ 3 ፤ CLRFWDT BCF STATUS ፣ RP0 BCF STATUS ፣ RP1 ፤ የባንክ ኢንኮን ፤ ቢሲኤፍ ኢንኮተን ፣ T0IE ፤ BCF INTCON ፣ T0IF ፤ BANKSEL PIE1 ፤ BCF PIE1 ፣ 6 ፤ BCF PIE1 ፣ 0 ፤ BANKSEL INONON;, 0 BCF PCON ፣ 1 NOP BSF PCON ፣ 0 BSF PCON ፣ 1 BCF STATUS ፣ RP0 BCF STATUS ፣ RP1 MOVLW 0X00 MOVWF MSTOP CALL SDELAY CALL LFC1 NOP CALL LFC2 NOP MOVF LR2 ፣ 0 SUBWF LR1 ፣ 0 BTFSC STT SDELAY CALL LFC1 NOP CALL LFC2 NOP MOVF LR2 ፣ 0 SUBWF LR1 ፣ 0 BTFSC STATUS ፣ C GOTO LR2G LR1G BCF STATUS ፣ RP0 BCF STATUS ፣ RP1 MOVLW 0X00 MOVWF MSTOP ፤ CALL BUTTVVTFVVTFVVTFELVEL; 0X66 MOVWF SPEED12 MOVLW 0XFF MOVWF SPEED21 MOVLW 0X99 MOVWF SPEED22 CALL PWM1ON CALL PWM2ON BSF PORTD ፣ 0 BCF PORTD ፣ 1 BSF PORTB ፣ 1 BCF PORTB ፣ 2 LR1GREP; OPS BANKSEL PIR1 BTFSC PIR1 ፣ RCIF GOTO RXDATA CALL LFC1 NOP CALL LFC2 NOP MOVF LR2 ፣ 0 SUBWF LR1 ፣ 0 BTFSC STATUS ፣ Z GOTO REPLF CALL LFC1 NOP CALL LFC2 NOP MOVF LR2, 0 SUBWUS ፣ 0 SUBWUS, 0 SUBW REPLF LR2G BCF ሁኔታ, RP0 BCF ሁኔታ, RP1 MOVLW 0X00 MOVWF MSTOP; ጥሪ BUTTLEVEL; BTFSC MSTOP, 1; Goto ማቆሚያዎች MOVLW 0XFF MOVWF SPEED11 MOVLW 0X99 MOVWF SPEED12 MOVLW 0XFF MOVWF SPEED21 MOVLW 0X66 MOVWF SPEED22 ጥሪ PWM1ON ጥሪ PWM2ON BCF PORTD: 0 BSF PORTD ፣ 1 BCF PORTB ፣ 1 BSF PORTB ፣ 2 LR2GREP ፤ CALL STALL1 ፣ BTFSC MSTOP ፣ 0 የሻዕቢያ ጥሪ LFC1 NOP CALL LFC2 NOP MOVF LR2 ፣ 0 SUBWF LR1 ፣ 0 BTFSC STATUS ፣ C GOTO LR2GREP GOTO REPLF ከፊት BCF STATUS ፣ RP0 BCF STATUS ፣ RP1 MOVLW 0X00 MOVWF MSTV; MOT BUTTT; SPEED11 MOVLW 0X99 MOVWF SPEED12 MOVLW 0XFF MOVWF SPEED21 MOVLW 0X99 MOVWF SPEED22 ጥሪ PWM1ON ጥሪ PWM2ON BCF ወደብ D ፣ 0 BCF PORTD ፣ 1 BSF PORTB ፣ 1 BSF PORTB ፣ 2 CALL SDELAY FROREP; CALL STALL1; BTFSC MSTOP ፣ 0; GOTO STANPS BANKSEL PIR1 BTFSC PIR1, RCIF GOTO RXDATA; CALL LDIN; BTFSC MSTOP, BTFSC MSTOP NOP CALL LFC2 NOP MOVF LR2 ፣ 0 SUBWF LR1 ፣ 0 BTFSC STATUS ፣ Z GOTO FROREP GOTO REPLF GOTO CLROE ፤ *************************** **************** BTFSS MSTOP ን ያቆማል ፣ 4 GOTO STOPA MOVLW 0XCF MOVWF SPEED11 MOVLW 0XB3 MOVWF SPEED12 MOVLW 0XCF MOVWF SPEED21 MOVLW 0XB3 MOVWF SPEED22 CALL PWMONON CALL PWMONON CALL PWMONON PALL 1 የጥሪ SDELAY STOPA BCF STATUS ፣ RP0 BCF STATUS ፣ RP1 BCF PORTB ፣ 1 BCF PORTB ፣ 2 BCF PORTB ፣ 6 BTFSS LDET ፣ 0; BCF PORTB ፣ 7 BCF PORTC ፣ 0 BCF PORTC ፣ 3 CALL PWM1OFF CALL PFM2 PORTD ፣ 1 BCF PORTD ፣ 2 BCF PORTD ፣ 3 MOVLW 0X00 MOVWF MSTOP ፤ *********************************** ********* ክሎይ ባንክ ባንክ RCSTA BCF RCSTA ፣ CREN BCF RCSTA ፣ FERR BCF RCSTA ፣ OERR BSF RCSTA ፣ CREN BSF INTCON ፣GIE BSF INTCON ፣ PEIE GOTO WAIT1 ፤ ****************************************** *; *******************************************; **** *************************************** STALL1 BCF STATUS ፣ RP0 BCF STATUS ፣ RP1 MOVLW 0X00 MOVWF MSTOP BANKSEL ADCON0 BCF ADCON0 ፣ 3 BCF ADCON0 ፣ 4 BCF ADCON0 ፣ 5 BCF STATUS ፣ RP0 BCF STATUS ፣ RP1 CALL CONVERT MOVF ADRESH ፣ 0 SUBLW 0X70 BTFSS STATUS ፣ C BSF MSFOP ፣ 0 BCFF ፣ 0 BCF STATUS ፣ RP0 BCF STATUS ፣ RP1 MOVLW 0X00 MOVWF MSTOP BANKSEL ADCON0 BSF ADCON0 ፣ 3 BCF ADCON0 ፣ 4 BCF ADCON0 ፣ 5 BCF STATUS ፣ RP0 BCF STATUS ፣ RP1 የጥሪ መለወጫ MOVF ADSS ፣ 0 SUB ፣ 0SUB ፣ 0 SUB ፣ ADSES ፣ 0 SUB STATUS ፣ RP0 BCF STATUS ፣ RP1 RETURNBUTTLEVEL BCF STATUS ፣ RP0 BCF STATUS ፣ RP1 MOVLW 0X00 MOVWF MSTOP BANKSEL ADCON0 BCF ADCON0 ፣ 3 BCF ADCON0 ፣ 4 BSF ADCON0 ፣ 0 BCFFT ፣ 0 BCFFT ፣ 0 BCF STFUS ፣ 0 BCF STFUS ፣ 0FF STFUS ፣ 0FF STFUS ፣ 0FF STFUS ፣ STFUS ፣ STFUS ፣ STFUS 0F BTFSS STATUS ፣ C GOTO BL1 GOTO BL2 BL1 BSF MSTOP ፣ 1 BSF PORTB ፣ 6 BL2 ተመለስ ጨለማ ጨለማ BCF STATUS ፣ RP0 BCF STATUS ፣ RP1 BTFSC LDET ፣ 0 GOTO RETFDL BANKSEL ADCON0 BCF ADCON0 ፣ 3 BSF ADCON0 ፣ 4 BCF ADCON0 ፣ 5 BCF STATUS ፣ RP0 BCF STATUS ፣ RP1 CALL CONVERT MOVF ADRESH ፣ 0 SUBLW 0XEE BTFSS STATUS ፣ C BSFONCBB ADBON ፣ ADBON ADBON ፣ ADBON ADBON ፣ ADBON ADBON ፣ ADBON ADBON BCF ADCON0 ፣ 7 BSF ADCON0 ፣ 6 BSF ADCON0 ፣ 0 BSF ADCON0 ፣ GO WAITADC BTFSC ADCON0 ፣ GO GOTO WAITADC BCF STATUS ፣ RP1 BCF STATUS ፣ RP0 RETURNPWM1ON BANKSEL PR2 MOVLW 0FFMFFFFF, 0FFMFF, 0FFMFFF, 0FFMFFFF, MFF0FF, MXFF 0FF MOVWF CCP1CON MOVF SPEED12 ፣ 0 MOVWF CCPR1L BSF STATUS ፣ RP0 BCF STATUS ፣ RP1 MOVLW 0XF0 MOVWF TRISC BCF STATUS ፣ RP0 BCF STATUS ፣ RP1 BCF T2CON ፣ T2CKPS1 BCF T2C2 ፣ B2CFON 2 PR2 MOVLW 0XFF MOVWF PR2 BCF STATUS ፣ RP0 BCF STATUS ፣ RP1 MOVF SPEED21 ፣ 0 MOVWF CCP2CON MOVF SPEED22 ፣ 0 MOVWF CCPR2L BSF STATUS ፣ RP0 BCF STATUS ፣ RP1 MOVLW 0FFCFF ፣ BCFFF ፣ BCFFF ፣ BCFTF ፣ BCFFF ፣ BCFFF ፣ BCFFF ፣ BCFFF ፣ BCF STF ፣ BCFTF ፣ BCF STC ፣ BCF STC ፣ BCF STC ፣ BCF STC ፣ BCF STC ፣ BCF STC ፣ BCF STC, STFUS BCF ፣ RCFC ፣ BCF ፣ STF ፣ BCF ፣ MFF ፣ ሌሎች T2CON ፣ T2CKPS0 BSF T2CON ፣ TMR2ON BSF CCP2CON ፣ 2 BSF CCP2CON ፣ 3 RETURNPW M1OFF BCF CCP1CON, 2 BCF CCP1CON, 3 BSF T2CON, T2CKPS1 BSF T2CON, T2CKPS0 BCF T2CON, TMR2ON MOVLW 0X00 MOVWF CCP1CON MOVLW 0X00 MOVWF CCPR1L BANKSEL PR2 MOVLW 0X00 MOVWF PR2 BCF ሁኔታ, RP1 BCF ሁኔታ, RP0 RETURNPWM2OFF BCF CCP2CON, 2 BCF CCP2CON ፣ 3 BSF T2CON ፣ T2CKPS1 BSF T2CON ፣ T2CKPS0 BCF T2CON ፣ TMR2ON MOVLW 0X00 MOVWF CCP2CON MOVLW 0X00 MOVWF CCPR2L BANKSEL PR2 MOVLW 0X00 MOVWF PRF BCC STATUS 5 BCF STATUS ፣ RP0 BCF STATUS ፣ RP1 ጥሪ ጥሪ MOVF ADRESH ፣ W ANDLW 0XF0 MOVWF LR1 BCF STATUS ፣ RP0 BCF STATUS ፣ RP1 ተመለስ LFC2 BANKSEL ADCON0 BCF ADCON0 ፣ 3 BSF ADFON0 ፣ 4 BF RP1 CALL CONVERT MOVF ADRESH ፣ 0 ANDLW 0XF0 MOVWF LR2 BCF STATUS ፣ RP0 BCF STATUS ፣ RP1 LDIN BANKSEL ADCON0 BCF ADCON0 ፣ 3 BSF ADCON0 ፣ 4 BCF ADCON0 ፣ 5 BCF STFUS ፣ RP0FF, STP STFUS ፣ RP 0X4C BTFSC STATUS ፣ C GOTO COMP4 BSF MSTOP ፣ 3 COMP4 BCF STATUS ፣ RP0 BCF STATUS ፣ RP1 SDELAY CLRF L2 XL3 CLRF L1 XL2 CLRF TMR0 XL1 MOVLW 0XFF SUBWF TMR0 ፣ W BTFSS STATUS ፣ C GOTO XL1 MOVLW 0X20 INCF L1 SUBWF L1 ፣ W BTFSS STATUS ፣ C GOTO X2 ኤክስ ኤል 3 ተመለስ ንቅ አለ

በአስተማሪዎቹ እና በሮቦጋሜስ ሮቦት ውድድር ውስጥ ሁለተኛ ሽልማት

የሚመከር: