Cov txheej txheem:
- Kauj Ruam 1: Tsim Txoj Haujlwm
- Kauj Ruam 2: Xaiv Cov Khoom Siv thiab Cov Khoom Siv
- Kauj Ruam 3: Tus Microcontroller
- Kauj Ruam 4: Sau PC Program
- Kauj Ruam 5: Tsim Lub Cev
- Kauj Ruam 6: Tsim Wireless Circuit
- Kauj Ruam 7: Sib koom ua ke
- Kauj Ruam 8: Tus Txheej Txheem Kev Tswj Xyuas Microcontroller
Video: Pob Zeb: 8 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:31
Tus neeg hlau no tau tswj hwm los ntawm qhov kev pom pom yooj yim (dhau ntawm qhov chaw nres nkoj txuas), thiab tuaj yeem txav mus rau hauv peb qhov sib txawv sib txawv los ntawm cov mem tes dav hloov (PWM) teeb liab tsim los ntawm PIC microcontroller (16F877). Tus neeg hlau tuaj yeem ua haujlwm nyob rau hauv ob hom, "tswj ib txwm" thiab "teeb tracker" hom. Hauv kev tswj hwm ib txwm muaj, tus neeg hlau tuaj yeem nqa cov khoom me me los ntawm 3 - 18 cm los ntawm qhov chaw mus rau lwm qhov hauv 150 m. whereas nyob rau hauv lub teeb tracker hom, nws ua raws li lub teeb nyob rau hauv chav tsaus nti. Many sensors tau siv, xws li lub teeb sensors; qaij sensor, tso tseg tam sim no paub, qib roj teeb pom tseeb, thiab qee qhov txwv kev hloov pauv thiab kov cov cim siv hauv tes. Nws tuaj yeem ua kom nws nrawm nrawm thaum nws nce toj (qaij) thiab cia li tig lub teeb thaum nws tsaus ntuj. Tsis tas li kom IC muaj kev nyab xeeb, nws cuam tshuam qhov tam sim no thaum nws raug kaw thiab txhais tes nres thaum tuav qee yam. 4 DC lub cev muaj zog tau siv tswj los ntawm PIC microcontroller 16F877 thiab 3 lub cav tsav tsheb. Nws siv li 4 lub hlis, thiab raug nqi txog 600 $.
Kauj Ruam 1: Tsim Txoj Haujlwm
ntawm thawj theem, tau tsim qauv ntawm qhov haujlwm. feem ntau, txheeb xyuas daim duab thaiv; saib daim duab.
Yuav tsum muaj daim duab qhia ntxaws ntxaws ntxiv nyob rau theem no, txawm li cas los xij, txhawm rau pab txhawb qhov no, cov qauv tseem ceeb tau txheeb xyuas yog: 1. Microcontroller 2. Sensors 3. Motors 4. Wireless circuit 5. PC program. Ib qho 3D Tsim tau ua tiav ib yam, saib daim duab.
Kauj Ruam 2: Xaiv Cov Khoom Siv thiab Cov Khoom Siv
Nyob rau theem no, tus tsim qauv yuav tsum xaiv cov cuab yeej thiab cov khoom siv xav tau los tsim cov neeg hlau.
Qhov no suav nrog: wireless Circuit (MAX232, LM331, FM transmitter and Receiver modules), motors (4 DC motors), motors drivers circuit (H-bridge), microcontroller PIC (16F877), Roj teeb, Kev tswj hluav taws xob (MC7805), Microswitches, Photoresistors, Tilt sensor … thiab lwm yam.
Kauj Ruam 3: Tus Microcontroller
Cov kauj ruam no yog kauj ruam tseem ceeb tshaj plaws. thaum pib, cov lej uas yuav tau txais thiab xa los ntawm PIC yuav tsum raug txheeb xyuas.
Pib txuas cov khoom siv rau tus pin tsim nyog ntawm PIC, thiab teeb tsa lub microcontroller. Qhov no yuav xav tau los tsim cov kab hluav taws xob me me siv tus tswj hwm, tiv thaiv, ntsuas … lwm yam.
Kauj Ruam 4: Sau PC Program
Qhov kev zov me nyuam tau sau rau ntawm qhov muag pom.
Kev sib txuas lus tau tsim los ntawm RS-232. Siv MSComm xa cov ntaub ntawv mus rau lub microcontroller los ntawm kev teeb tsa cov chaw (tus lej chaw nres nkoj, tus nqi baud, tus lej sib npaug ntawm cov ntaub ntawv khoom, nres cov khoom). Kuv siv 8-ntsis cov ntaub ntawv nrog ib qho nres me ntsis thiab sib npaug ntawm tus nqi baud 9600 bps.
Kauj Ruam 5: Tsim Lub Cev
Kev tsim qauv zoo ntawm lub cev yog qhov tseem ceeb. Kuj xaiv lub log log, saib daim duab.
nws neeg hlau tau tsim tom qab ua pov thawj tias cov haujlwm tau ua haujlwm zoo. Cov kauj ruam no tuaj yeem ua tiav ua ntej lub cajmeem.
Kauj Ruam 6: Tsim Wireless Circuit
Lub tsev tsim hluav taws xob wireless tuaj yeem ywj siab. Hauv thawj theem, Kuv tau siv xaim txuas lub PC nrog cov neeg hlau, thiab tom qab ua tiav cov neeg hlau, cov xov tooj hluav taws xob tau txuas nrog.
Kauj Ruam 7: Sib koom ua ke
Nov yog lub sijhawm uas peb tau koom ua ke peb cov khoom, thiab sim cov neeg hlau.
Kauj Ruam 8: Tus Txheej Txheem Kev Tswj Xyuas Microcontroller
; *************** FINAL ******************************** npe p = 16f877 suav nrog radix decidlocs "V" << 8 | "1"; Version No.config _CP_OFF & _PWRTE_OFF & _WDT_OFF & _XT_OSC; ********** lub ntsiab sib txawv *************************** thaiv 0x20; pib ntawm bank 0 ram cheeb tsam INPUT_VAR L1 L2 X SPEED11 SPEED12 SPEED22 SPEED22 MSTOP LDET LR1 LR2 endc; ********** pib ntawm txoj haujlwm tseem ceeb *************** pib BSF STATUS, RP0 BCF STATUS, RP1 MOVLW 0X40 MOVWF ADCON1 MOVLW 0XFF; PORT A YOG I MOVWF TRISA MOVLW 0X00; PORT B YOG O MOVWF TRISB MOVLW 0XF0; PORT C YOG I/O MOVWF TRISC MOVLW 0XF0; PORT D YOG TRISD MOVLW 0X07; PORT E YOG I MOVWF TRISE BANKSEL OPTION_REG BCF OPTION_REG, T0CS BCF STATUS, RP1 BCF STATUS, RP0; ************************* ******************; ********************************** ************ WAIT BCF PORTB, 1 BCF PORTB, 2 BCF PORTB, 6 CALL PWM1OFF CALL PWM2OFF BCF PORTD, 0 BCF PORTD, 1 BCF PORTD, 2 BCF PORTD, 3 BTFSS LDET, 0 BCF PORTB, 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, SPEN BTFSC 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 PIR1 BTFSS PIR1, BCF BOT1, BCF BOTBF, BCR BOTBTS, BCF PORB, BCR BOTBTS, BCF BORK, BCF PORB CALL PWM1OFF CALL PWM2OFF CALL DARKLIGHT BTFSC LDET, 0 BSF PORTB, 7RXDATA; BANKSEL RCSTA; BTFSC RCSTA, OERR; GOTO STOPS CALL PWM1OFF CALL PWM2OFF CALL DARKLIGHT BFFBL BFF1 BFF1 BFBL BFB1 BFF1 BFB1 BFF1 BFB1 BFF1 BFB1 BFF1 BFB1 BFF1 0; ****************************************************** *************************************** MOVWF INPUT_VAR MOVLW 0X00 MOVWF RCREG BCF STATUS, RP0 BCF STATUS, RP1 MOVF INPUT_VAR, 0; STOP SUBLW 0X53 BTFSC STATUS, Z GOTO STOPS MOVF INPUT_VAR, 0; LIGHT ON SUBLW 0X4E BTFSC STATUS, Z GOTO LON MOVF INPUT_VAR, 0; LIGHT OFF SUBLW INFUT_VAR, 0; LIGHT OFF SUBLW ZOX, BTFF BTFF STATUS 0; QHOV TSEEB QHOV TSEEB QHOV QAB SUBLW 0X66 BTFSC STATUS, Z GOTO FSLOW MOVF INPUT_VAR, 0; QHOV RIGHT SLOW SUBLW 0X72 BTFSC STATUS, Z GOTO RSLOW MOVF INPUT_VAR, 0; QHOV QAB QAB QAB QAB QAB SUBLW 0 X6C BTFSC STATUS, Z GOTO LSLOW MOVF INPUT_VAR, 0; QHIA BACKWARD SLOW SUBLW 0X62 BTFSC STATUS, Z GOTO BSLOW MOVF INPUT_VAR, 0; MOVE FORWARD MEDIUM SUBLW 0X46 BTFSC STATUS, Z GOTO FMEDF0 METFMET MOUNT STATUS, Z GOTO RMED MOVF INPUT_VAR, 0; MOVE LEFT MEDIUM SUBLW 0X4C BTFSC STATUS, Z GOTO LMED MOVF INPUT_VAR, 0; MOVE BACKWARD MEDIUM SUBLW 0X42 BTFSC STATUS, Z GOTO BMED MOVF 0FF, BTFWFF STFUS, FFTWFF STATUS, Z GOTO LMED MOVF INPUT_VAR, 0; Z GOTO FFAST MOVF INPUT_VAR, 0; CUAV RIGHT FAST SUBLW 0X57 BTFSC STATUS, Z GOTO RFAST MOVF INPUT_VAR, 0; MOVE TSHIAB SUBLW 0X56 BTFSC STATUS, Z GOTO LFAST MOVF INPUT_VAR 0FTT8 ZAR, Z GOTO LFAST MOVF INPUT_VAR 0 BFAST MOVF INPUT_VAR, 0; HAIS KOOB SUBLW 0X43 BTFSC STATUS, Z GOTO HCLOSE MOVF INPUT_VAR, 0; HAND OPV SUBLW 0X4F BTFSC STATUS, Z GOTO HOPEN MOVF INPUT_VAR, 0; HAND UP SUBLW 0X75; HAND DOWN SUBLW 0X64 BTFSC STATUS, Z GOTO HDOWN MOVF INPUT_VAR, 0; LIGHT FOLOWE R SUBLW 0X54 BTFSC STATUS, Z GOTO LFOLLOW; **************************************** ***; *************************************************** GOTO CLROEFSLOW; BANKSEL RCSTA; BCF RCSTA, OERR; BCF RCSTA, CREN; NOP; BSF RCSTA, CREN BCF STATUS, RP0 BCF STATUS, RP1 MOVLW 0X00 MOVWF MSTOP; BCF LDET, 0; BUTTLEVEL LDET, 0; BSF PORTB, 7 NORMALSLOW MOVLW 0XFF MOVWF SPEED11 MOVLW 0X66 MOVWF SPEED12 MOVLW 0XFF MOVWF SPEED21 MOVLW 0X66 MOVWF SPEED22 CALL PWM1ON CALL PWM2ON BCF PORTD, 0 BFB1 BFB1, BFBB1, BFB1, BFB1, BFB1, BFB1, BFB1, BFB1, BFB1, BFB1, BFB1, BFB1, BFB1, RCIF GOTO RXDATA GOTO REP3 GOTO CLROE; ********************************************* ** LSLOW BCF STATUS, RP0 BCF STATUS, RP1; Hu rau BUTTLEVEL; BTFSC MSTOP, 1; GOTO STOPS MOVLW 0X00 MOVWF MSTOP BCF LDET, 0 CALL DARKLIGHT BTFSC LDET, 0; BSF PORTB, 7 MOVLW 0XFF11 MOVWW 0XFF12 0XCF MOVWF SPEED21 MOVLW 0X66 MOVWF SPEED22 CALL PWM1ON CALL PWM2ON BSF PORTD, 0 BCF PORTD, 1 BSF PORTB, 1 BCF POR TB, 2 REP4 BANKSEL PIR1 BTFSC PIR1, RCIF GOTO RXDATA GOTO REP4 GOTO CLROE; ************************************** ********** RSLOW BCF STATUS, RP0 BCF STATUS, RP1; Hu rau BUTTLEVEL; BTFSC MSTOP, 1; GOTO STOPS MOVLW 0X00 MOVWF MSTOP BCF LDET, 0 CALL DARKLIGHT BTFSC LDET, 0; BSF PORTB, 7 MOVLW 0XCF MOVWF SPEED11 MOVLW 0X66 MOVWF SPEED12 MOVLW 0XFF MOVWF SPEED21 MOVLW 0X99 MOVWF SPEED22 CALL PWM1ON CALL PWM **************************** BSLOW BCF STATUS, RP0 BCF STATUS, RP1 MOVLW 0X00 MOVWF MSTOP BCF LDET, 0; Hu rau BUTTLEVEL; BTFSC 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 0X99 MOVWF SPEED22 CALL PWM BON 1, BFF PWM1, BWM BWM PWM1 PORTB, 2 REP5 BANKSEL PIR1 BTFSC PIR1, RCIF GOTO RXDATA GOTO REP5 GOTO CLROE; ************************************** ********** F MED BCF STATUS, RP0 BCF STATUS, RP1 MOVLW 0X00 MOVWF MSTOP BCF LDET, 0; CALL BUTTLEVEL; BTFSC MSTOP, 1; GOTO STOPS CALL DARKLIGHT BTFSC LDET, 0; BSF PORTB, 7 NORMALMED MOVBWFFX11 MOV0WFX11 MOV 0 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 BANFSE BANFSE BANFSE BANFSE BANKSE 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, 1 BSTF PSL PTSB, 1 BSTF PSL PTSB 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; BUTTLEVEL; BTFSC MSTOP, 1; GOTO STOPS CALL DARKLIGHT BTFSC LDET, 0; BSF PORT B, 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 PORB, 1 BSTF BALT BSTF, BSTF BST1, BSTF BST1, BSTF BST1 BTFSC PIR1, RCIF GOTO RXDATA GOTO REP8 GOTO CLROE; *********************************************** **** LMED 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 MOVLW 0XFF11 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 MSTOPO, GOTFO1BTS, BOTFO1, GOTKO STAR1 REP9 GOTO CLROE; ******************************************* BMED BCF STATUS, RP0 BCF STATUS, RP1 MOVLW 0X00 MOVWF MSTOP BCF LDET, 0; Hu rau BUTTLEVEL; BTFSC MSTOP, 1; GOTO STOPS CALL DARKLIGHT BTFSC LDET, 0; BSF PORTB, 7 MOVLW 0XFF MOVWF SPEED11 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 PORTB, 2 REP10 CALIR STALLSTO1 BFTO GTS BFT1 BFPS B1 BFT1 BFT1 BFPS B1 BFT1 BFT1 BFTG BFT1 BFT1 REP10 GOTO CLROE; ******************************************* FFAST BCF STATUS, RP0 BCF STATUS, RP1 MOVLW 0X00 MOVWF MSTOP BCF LDET, 0 BSF MSTOP, 4; BUTTLEVEL; BTFSC MSTOP, 1; GOTO STOPS CALL DARKLIGHT BTFSC LDET, 0; BSF PORTB, 7 MOVLWX0XEF MOVWF SPE11 MOVWF SPEED21 MOVLW 0X7F MOVWF SPEED22 CALL PWM1ON CALL PWM2ON BCF PORTD, 0 BCF PORTD, 1 BSF PORTB, 1 BFF PORTB, 2 CALL SDELAY NORMALFAST MOVLW 0XCF PORTD, 0 BCF PORTD, 1 BTFSC LDET, 0 BSF PORTB, 7 BSF PORTB, 1 BSF PORTB, 2 REP11 CALL STALL1 BTFSC MSTOP, 0 GOTO STOPS BANKSEL PIR1 BTFSC PIR1, RCIF GOTO RXDATA NOP BTFSS PORTS AST MOVLW 0XCF MOVWF SPEED11 MOVLW 0XFF MOVWF SPEED12 MOVLW 0XCF MOVWF SPEED21 MOVLW 0XFF MOVWF Speed22, 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; BUTTLEVEL; BTFSC MSTOP, 1; GOTO STOPS CALL DARKLIGHT BTFSC LDET, 0; BSF PORTB, 7 MOVLW 0XF 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 PORTB, 2 REP13 CALL STALTS BOKT1 BALTTS BALT1 BALTTS BALTTS BALTTS BALT1 BALTTS BALT1 BALTTS BALT1 BALTTS BALTPS GOTO REP13 GOTO CLROE; ******************************************* LFAST BCF STATUS, RP0 BCF STATUS, RP1 MOVLW 0X00 MOVWF MSTOP BCF LDET, 0; Hu rau BUTTLEVEL; BTFSC MSTOP, 1; GOTO STOPS DALLIGHT BTFSC LDET, 0; BSF PORTB, 7 MOVLW 0XFF MOVWF SPEED11 MOVLW 0X66 MOVWF SPEED12 MOVLW 0XFF MOVWF SPEED21 MOVLW 0X99 MOVWF SPEED22 CALL PWM1ON CALL PWM2ON BSF PORTD, 0 BCF PORTD, 1 BCF PORTBE, 1 BCF PWTB, 1 BCF PWTB, 1 BCF PWTB, 1 BCF PWTB, 1 BCF PWTB, 1 BCF PWTB, 1 BCF PWG 0XEF MOVWF SPEED21 MOVLW 0XB3 MOVWF SPEED22 CALL PWM1ON CALL PWM2ON BSF PORTD, 0 BCF PORTD, 1 BOSF PORTB, 1 BCF PORTB, 2 REP14 CALL STALL1 BTFSC MSTOP, 0 GOTO STOPS BANKSEL PKROX PKRO1 POOTROXO BOTROX PONDROX POOTROX1 BOTKROX GOTO PONDROX PONDROX PONDROX PONDROX PONDROX PONDROX POTB1 ********************************************* BFAST 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 MOVLW 0XDF MOVWF SPEED11 MOVLW 0X99 MOVWF SPEED12 CWL 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 MOVLW 0X66 MOVWF SPEED22 CALL PWM1 PORTD, 0 BSF PORTD, 1 BCF PORTB, 1 BCF PORTB, 2 REP15 CALL STALL1 BTFSC MSTOP, 0 GOTO STOPS BANKSEL PIR1 BTFSC PIR1, RCIF GOTO RXDATA GOTO REP15 GOTO CLROE; ************* ****************************** HCLOS BCF STATUS, RP0 BCF STATUS, RP1 MOVLW 0X00 MOVWF MSTOP BCF LDET, 0; Hu rau BUTTLEVEL; BTFSC MSTOP, 1; GOTO STOPS CALL DARKLIGHT BTFSC LDET, 0; BSF PORTB, 7 BTFSC PORTD, 5 GOTO STOPS BTFSC PORTD, 6 GOTO STOPS BSF PORTD, 2 BCF PORTD, 3 REP16 BTFSC PORTD, 5 GOTO STOPS GOTO STOPS CALL SDELAY CALL STALL2 BTFSC MSTOP, 2 GOTO STOPS 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; Hu rau BUTTLEVEL; BTFSC MSTOP, 1; GOTO STOPS CALL DARKLIGHT BTFSC LDET, 0; BSF PORTB, 7 BTFSC PORTD, 4 GOTO STOPS BCF PORTD, 2 BSF PORTD, 3 REP17 BTFSC PORTD, 4 GOTO STOPS CALL SDELAY CALL STALL2 BTFSC MSTOP, 2 GOTO STOPS BANKSEL PIR1 BTFSC PIRO GOTO CLROE; ******************************************* HUP BCF STATUS, RP0 BCF STATUS, RP1 MOVLW 0X00 MOVWF MSTOP BCF LDET, 0; Hu rau BUTTLEVEL; BTFSC MSTOP, 1; GOTO STOPS CALL DARKLIGHT BTFSC LDET, 0; BSF PORTB, 7 BTFSC PORTC, 4 GOTO STOPS BCF PORTC 3, BCF PORTC 0 BTFSC PORTC, 4 GOTO STOPS 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; BUTTLEVEL; BTFSC MSTOP, 1; GOTO STOPS CALL DARKLIGHT BTFSC LDET, 0; BSF PORTB, 7 BTFSC PORTC, 5 GOTO STOPS BSF PORTC, 0 BCF PORTC, 3 REP19 BTFSC PORTC, 5 GOTO STOPS BANKSEL PIR1 BTFSC PIR1, RCIF GOTO RXDATA GOTO REP19 GOTO CLROE; *************** **************************** LON BSF PORTB, 7 BSF LDET, 0 GOTO CLROE; ********** ********************************* LOFF BCF PORTB, 7 BCF LDET, 0 GOTO CLROE; ***** ************************************* LFOLLOW BCF STATUS, RP0 BCF STATUS, RP1 BCF PORTB, 1 BCF PORTB, 2 BCF PORTB, 6 BCF PORTB, 7 CALL PWM1OFF CWM PWM2OFF BCF PORTD, 0 BCF PORTD, 1 BCF PORTD, 2 BCF PORTD, 3 BSF MSTOP, 6 REPLF; BANKSEL OPTION_REG; BSF OPTION_REG, 3; BSF OPTION_REG,, 3; CLRFWDT BCF STATUS, RP0 BCF STATUS, RP1; BANKSEL INTCON; BCF INTCON, T0IE; BCF INTCON, T0IF; BANKSEL PIE1; BCF PIE1, 6; BCF PIE1, 0; BANKSEL INTCON BCC, 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 STATUS, 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 BUTTLEVEL MTSOP 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; CALL STALST1; BTF MTS 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 SUBWF LR2, 0 SUBWF LR2, 0 CWT REPLF LR2G BCF STATUS, RP0 BCF STATUS, RP1 MOVLW 0X00 MOVWF MSTOP; CALL BUTTLEVEL; BTFSC MSTOP, 1; GOTO STOPS MOVLW 0XFF MOVWF SPEED11 MOVLW 0X99 MOVWF SPEEDED MOVLW 0XFWWFXFWWFXWFXWFXWXFWWFXWFXWXFWWFXWWXFWWFXFWWFXFWWFXFWWFXFWWFXFWWFXFWWFXFWWFXFWWWXFWWFX PORTD, 1 BCF PORTB, 1 BSF PORTB, 2 LR2GREP; CALL STALL1; BTFSC MSTOP, 0; GOTO STOPS BANKSEL PIR1 BTFSC PIR1, RCIF GOTO RXDATA CALL LFC1 NOP CALL LFC2 NOP MOVF LR2, 0 SUB REPLF CALL LFC1 NOP CALL LFC2 NOP MOVF LR2, 0 SUBWF LR1, 0 BTFSC STATUS, C GOTO LR2GREP GOTO REPLF FRONT BCF STATUS, RP0 BCF STATUS, RP1 MOVLW 0X00 MOVWF MSTOP; CALL BUTTV SPEED11 MOVLW 0X99 MOVWF SPEED12 MOVLW 0XFF MOVWF SPEED21 MOVLW 0X99 MOVWF SPEED22 CALL PWM1ON CALL PWM2ON BCF PORT D, 0 BCF PORTD, 1 BSF PORTB, 1 BSF PORTB, 2 CALL SDELAY FROREP; CALL STALL1; BTFSC MSTOP, 0; GOTO STOPS BANKSEL PIR1 BTFSC PIR1, RCIF GOTO RXDATA; CALL LDIN; BTFSC MSTOP, 3 NOP CALL LFC2 NOP MOVF LR2, 0 SUBWF LR1, 0 BTFSC STATUS, Z GOTO FROREP GOTO REPLF GOTO CLROE; *************************** **************** STOPS BTFSS MSTOP, 4 GOTO STOPA MOVLW 0XCF MOVWF SPEED11 MOVLW 0XB3 MOVWF SPEED12 MOVLW 0XCF MOVWF SPEED21 MOVLW 0XB3 MOVWF SPEED22 CWM PWM1ON 1 CALL 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 PWM2OFF BCF PWM2OFF PORTD, 1 BCF PORTD, 2 BCF PORTD, 3 MOVLW 0X00 MOVWF MSTOP; ************************************** ********* CLROE BANKSEL 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 MSTOP, 0 BCF BCST STATUS, 0 BCF BCST STATUS, 0 BCF BCST STATUS 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 CALL CONVERT MOVF ADRESH, 0 CWL BFF, 0 CWF BST 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, 5 BCF STATES 0, BCP STF BTFSS STATUS, C GOTO BL1 GOTO BL2 BL1 BSF MSTOP, 1 BSF PORTB, 6 BL2 Rov Qab DARKLIGHT BCF STATUS, RP0 BCF STATUS, RP1 BTFSC LDET, 0 GETO 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, CWF BONNC0BETC, BETTON0, BETTON0, BETTON0, BETTON0, BETCON BETC, BETCON BETC, BETC, BETK 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 0XFF BCF, WFF BCF, WFFF, WFFF, WFFF, WFFF, WFF1, WFFF, WFFF, WFFF, RM0 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 T2CON, T2CKC2 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 0XF0 MOVWF TRISC BCP STC1 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 BANKSEP PRP2, 3 BSF T2CON, T2CKPS1 BSF T2CON, T2CKPS0 BCF T2CON, TMR2ON MOVLW 0X00 MOVWF CCP2CON MOVLW 0X00 MOVWF CCPR2L BANKSEL PR2 MOVLW 0X00 MOVWF PR2 BCF STATUS, RP1 BCF ADC0, BCR ADC, BCP ADC, ADC, ADC, ADC, ADC, ADC, ADC, ADC, ADC, BCP, ADC 5 BCF STATUS, RP0 BCF STATUS, RP1 CALL CONVERT MOVF ADRESH, W ANDLW 0XF0 MOVWF LR1 BCF STATUS, RP0 BCF STATUS, RP1 RETURN LFC2 BANKSEL ADCON0 BCF ADCON0, 3 BSF ADCON0, 4 BSF ADCON0, 4 BSF ADCON0, RP1 CALL CONVERT MOVF ADRESH, 0 ANDLW 0XF0 MOVWF LR2 BCF STATUS, RP0 BCF STATUS, RP1 RETURN LDIN BANKSEL ADCON0 BCF ADCON0, 3 BSF ADCON0, 4 BCF ADCON0, 5 BCF STATER, RP0 BCR STATER, RP0 STL 0X4C BTFSC STATUS, C GOTO COMP4 BSF MSTOP, 3 COMP4 BCF STATUS, RP0 BCF STATUS, RP1 RETURN 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 XL2 MOVLW 0X, XL3 Rov NOP NOPEND
Qhov khoom plig thib ob hauv Kev Qhia thiab RoboGames Robot Contest
Pom zoo:
Hloov Lub Pob Ntseg Pob Ntseg Pob Ntseg: 7 Cov Kauj Ruam
Hloov Lub Pob Ntseg Pob Ntseg Pob: Hloov koj lub pob ntseg tuaj yeem ua pa lub neej tshiab rau hauv lub mloog pob ntseg qub. Qhov zoo tshaj plaws txhua qhov koj tuaj yeem ua nws koj tus kheej nrog cov qauv kev lom zem sab hauv ntawm lub pob ntseg. Kuv tau muaj lub mloog pob ntseg no txog 8 xyoo thiab cov tawv faux tau pib tawg
99 ¢ Foppy Fais Fab Txuas Hluav Taws Xob LED Pob Pob Zeb: 8 Kauj Ruam
99 ¢ Foppy Fais Fab Txuas Hluav Taws Xob LED Pob Pob Zeb: Qhov no yog qhov kos duab me me, ua ke nrog cov qub floppy tsav lub zog txuas, lub tshuab luam ntawv USB seem, thiab tsawg dua 1 $ ntawm LED's & Resistors
Tig Ib Lub Pob Ntseg Rau Hauv Lub Pob Ntseg Pob Ntseg (tsis cuam tshuam) Tsis tas ua kom lub mloog pob ntseg puas: 9 kauj ruam
Tig Ib Lub Pob Ntseg Rau Hauv Lub Pob Ntseg (tsis cuam tshuam) Tsis Ua Lub Pob Ntseg: Qhov no yog lub tswv yim kuv tau tawm ntawm xiav tom qab ib tus phooj ywg muab rau kuv qee lub pob ntseg supercheap tawg. Nws yog lub khoos phis tawj microphone uas tuaj yeem txuas nrog lub mloog pob ntseg yuav luag txhua lub mloog pob ntseg (Kuv nyiam qhov no vim tias kuv tuaj yeem ua game nrog lub mloog pob ntseg siab thiab
Txhim Kho Hauv Pob Ntseg Pob Ntseg (Pob Ntseg-Pob Nyiaj): 6 Cov Kauj Ruam
Txhim Kho Pob Ntseg Hauv Pob Ntseg (Pob Ntseg Pob Ntseg): Cov pob ntseg pob ntseg tsis haum rau kuv pob ntseg. Tab sis muaj kev daws teeb meem yooj yim rau qhov ntawd
USB Casting hauv Pob Zeb Pob Zeb: 6 Kauj Ruam
USB Casting hauv Pob Zeb Pob Zeb: Kuv tau ua USB dongle hauv pob tshab pob tshab. Cov txheej txheem siv yog cob los ntawm kev siv cov pwm silicon. Qhov ntawd yog cov npe khoom thiab cov cuab yeej siv: -USB dongle, zoo tshaj qub qub thawj zaug, vim nws muaj qhov pheej hmoo ua rau nws puas tsuaj.-LEGO daim los ua