Orodha ya maudhui:
- Hatua ya 1: Buni Mradi
- Hatua ya 2: Chagua Vifaa na Vipengele
- Hatua ya 3: Mdhibiti Mdogo
- Hatua ya 4: Andika Programu ya PC
- Hatua ya 5: Jenga Mwili
- Hatua ya 6: Jenga Mzunguko Usio na waya
- Hatua ya 7: Jumuisha
- Hatua ya 8: Nambari ya Programu ya Udhibiti Mdogo
Video: Mwamba: 8 Hatua
2024 Mwandishi: John Day | [email protected]. Mwisho uliobadilishwa: 2024-01-30 12:55
Roboti hii inadhibitiwa na programu ya msingi ya kuona (kupitia bandari ya serial), na inaweza kusonga kwa kasi tatu tofauti na ishara ya upana wa mpigo (PWM) inayotokana na microcontroller ya PIC (16F877). Roboti inaweza kuendeshwa kwa njia mbili, "udhibiti wa kawaida" na njia za "tracker nyepesi". Katika hali ya kawaida ya kudhibiti, roboti inaweza kubeba vitu vyenye ukubwa kutoka 3 - 18 cm kutoka mahali hadi nyingine ndani ya mita 150. wakati katika hali ya mfuatiliaji mwepesi, inafuata taa kwenye chumba chenye giza. Sensorer nyingi zilitumika, kama sensorer nyepesi; tilt sensor, duka sasa kuhisi, kuhisi kiwango cha betri, na swichi za kikomo na sensorer za kugusa zinazotumiwa mkononi. Inaweza kuweka kasi yake kila wakati inapokwenda kwenye kilima (imeinama) na kuwasha taa kiatomati wakati inakuwa giza nyeusi. Pia kuweka IC salama, hukata umeme wakati umekwama na mkono unasimama wakati wa kushikilia kitu. 4 motors DC zilitumiwa kudhibitiwa na PIC microcontroller 16F877 na nyaya za dereva 3. Ilichukua kama miezi 4, na inagharimu $ 600
Hatua ya 1: Buni Mradi
katika hatua ya awali, muundo wa mradi ulitolewa. haswa, kufafanua mchoro wa block; tazama takwimu.
Mchoro wa Mzunguko wa kina unahitajika katika hatua hii, hata hivyo, kuwezesha hii, moduli kuu zilizoainishwa zilikuwa: 1. Microcontroller 2. Sensorer. 3. Motors 4. Mzunguko wa waya 5. Programu ya PC. Ubunifu wa 3d ulifanyika pia, angalia takwimu.
Hatua ya 2: Chagua Vifaa na Vipengele
Katika hatua hii, mbuni anapaswa kuchagua vifaa na vifaa vinavyohitajika kujenga roboti.
Hii ni pamoja na: mzunguko wa waya (MAX232, LM331, transmitter ya FM na moduli za Mpokeaji), motors (4 DC motors), mzunguko wa madereva wa motors (H-daraja), microcontroller PIC (16F877), Battery, vidhibiti vya Voltage (MC7805), Microswitches, Photoresistors, sensor Tilt… nk Ni muhimu kuelewa utangamano wa vifaa hivi na jinsi zinavyofanya kazi pamoja.
Hatua ya 3: Mdhibiti Mdogo
Hatua hii ni hatua muhimu zaidi. mwanzoni, nambari ambazo zitapokelewa na kupitishwa kutoka kwa PIC zinapaswa kutambuliwa.
Anza kuunganisha vifaa kwenye pini zinazofaa za PIC, na upange mpango mdogo wa kudhibiti. Hii inaweza kuhitaji kujenga nyaya ndogo kwa kutumia vidhibiti, vipinga, sensorer… nk.
Hatua ya 4: Andika Programu ya PC
Programu hiyo iliandikwa kwa msingi wa kuona.
Mawasiliano ilianzishwa kupitia RS-232. Kutumia MSComm kutuma data kwa microcontroller kwa kusanidi mipangilio (nambari ya bandari, kiwango cha baud, idadi ya usawa wa bits za data, bits bits). Nilitumia data ya 8-bit na kuacha kidogo na usawa katika kiwango cha baud 9600 bps.
Hatua ya 5: Jenga Mwili
Muundo mzuri wa mwili ni muhimu. Pia kuchagua mpangilio wa gurudumu, angalia takwimu.
yeye robot ilijengwa baada ya kuhakikisha kuwa programu zinafanya kazi vizuri. Hatua hii inaweza kufanywa kabla ya programu pia.
Hatua ya 6: Jenga Mzunguko Usio na waya
Kujenga mzunguko wa wireless inaweza kuwa huru. Katika hatua ya mwanzo, nilitumia waya kuunganisha PC na roboti, na baada ya kumaliza roboti, mzunguko wa waya ulijumuishwa.
Hatua ya 7: Jumuisha
Huu ndio wakati tulipounganisha vifaa vyetu, na kujaribu roboti.
Hatua ya 8: Nambari ya Programu ya Udhibiti Mdogo
; p = 16f877 ni pamoja na decidlocs za radix "V" << 8 | "1"; Toleo No.config _CP_OFF & _PWRTE_OFF & _WDT_OFF & _XT_OSC; benki 0 eneo la kondoo mume INPUT_VAR L1 L2 X SPEED11 SPEED12 SPEED21 SPEED22 MSTOP LDET LR1 LR2 endc; ********** kuanza kwa mpango kuu *************** kuanza BSF STATUS, RP0 BCF STATUS, RP1 MOVLW 0X40 MOVWF ADCON1 MOVLW 0XFF; PORT A IS I MOVWF TRISA MOVLW 0X00; PORT B IS O MOVWF TRISB MOVLW 0XF0; Port C NI I / O MOVWF TRISC MOVL 0 TRISD MOVLW 0X07; PORT E NDIYO MOVWF TRISE BANKSEL OPTION_REG BCF OPTION_REG, T0CS BCF STATUS, RP1 BCF STATUS, RP0; ***************************** ******************; *********************************** ************ Subiri BCF PORTB, 1 BCF PORTB, 2 BCF PORTB, 6 PIGA PWM1OFF PIGA 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 BTF, 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, RCIF GOT, RCIF GOT, RCIF GOT PIGA PWM1OFF CALL PWM2OFF CALL DARKLIGHT BTFSC LDET, 0 BSF PORTB, 7RXDATA; BANKSEL RCSTA; BTFSC RCSTA, OERR; GOTO STOPS PIGA PWM1OFF CALL PWM2OFF CALL DARKLIGHT BTFSC LDET, RBBB RBBB RBBB RBBB RBBB RFB, RFB RRBRBB, RFBRB RBB RRBB, RSBFRB RRBRB, RBB RRBB, RFB RRBRB, RBRRBS RBBRB, RBRRBET RB, RBRBET RRBRB, RBRRBB RRRRGRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR) 0; **********************************************; **** *************************************** MOVWF INPUT_VAR MOVLW 0X00 MOVWF RCREG BCF STATUS, RP0 BCF STATUS, RP1 MOVF INPUT_VAR, 0; ACHA SUBLW 0X53 BTFSC STATUS, Z GOTO STOPS MOVF INPUT_VAR, 0; MWANGA KWENYE SUBLW 0X4E BTFSC STATUS, Z GOTO LON MOVF INPUT_VAR, 0; LIGHT OFF SUBLW GLOB, 0 SONGA MBELE PELEZA SUBLW 0X66 BTFSC STATUS, Z GOTO FSLOW MOVF INPUT_VAR, 0; SUKA KULIA polepole SUBLW 0X72 BTFSC STATUS, Z GOTO RSLOW MOVF INPUT_VAR, 0; HAMIA KUSHOTOZA SUBLW 0 HALI YA X6C BTFSC, Z GOTO LSLOW MOVF INPUT_VAR, 0; SUKA BACKWARD SLOW SUBLW 0X62 BTFSC STATUS, Z GOTO BSLOW MOVF INPUT_VAR, 0; SONGA MBELE MEDIUM SUBLW 0X46 BTFSC STATUS, Z GOTO FM5TB MOBITSIMU YA SIKILIZA, ZIMAIMBIA MIMI. STATUS, Z GOTO RMED MOVF INPUT_VAR, 0; Hoja KUSHOTO MEDIUM SUBLW 0X4C BTFSC STATUS, Z GOTO LMED MOVF INPUT_VAR, 0; SUKA BACKWARD MEDIUM SUBLW 0X42 BTFSC STATUS, Z GOTO BMED MOVFP 0 Z GOTO FFAST MOVF INPUT_VAR, 0; NENDA KWENYE HARAKA ZAIDI SUBLW 0X57 BTFSC STATUS, Z GOTO RFAST MOVF INPUT_VAR, 0; SUKA KWA SASA SUBLW 0X56 BTFSC STATUS, Z GOTO LFAST MOVF INPUT_VAR, 0; 0; BFAST MOVF INPUT_VAR, 0; MKONO FUNGA SUBLW 0X43 BTFSC STATUS, Z GOTO HCLOSE MOVF INPUT_VAR, 0; MKONO WAFUNGUA SUBLW 0X4F BTFSC STATUS, Z GOTO HOPEN MOVF INPUT_VAR, 0; HAND UP SUBLOT 0; MKONO CHINI SUBLW 0X64 BTFSC STATUS, Z GOTO HDOWN MOVF INPUT_VAR, 0; MWANGA UIFUATAYO R SUBLW 0X54 BTFSC STATUS, Z GOTO LFOLLOW; **************************************** ***; ***** BANKSEL RCSTA; BCF RCSTA, OERR; BCF RCSTA, CREN; NOP; BSF RCSTA, CREN BCF STATUS, RP0 BCF STATUS, RP1 MOVLW 0X00 MOVWF MSTOP; LDET, 0; BSF PORTB, 7 NORMALSLOW MOVLW 0XFF MOVWF SPEED11 MOVLW 0X66 MOVWF SPEED12 MOVLW 0XFF MOVWF SPEED21 MOVLW 0X66 MOVWF SPEED22 PIGA PWM1ON CALL PWMPBB PBB PB, 2B BCF PB, 2B BCF PB, 2B BCF PB, 2B BCF PB, 2B BCF PB, 2B BCF PB, 2B BCF PB, 2B BCF PB, 1B BCF PB, 2B BCF PB, 1B BCF PB, 2B BCF PB, MFANYAKAZI YA 1, RCIF GOTO RXDATA GOTO REP3 GOTO CLROE; ***************************************** ** LSLOW BCF STATUS, RP0 BCF STATUS, RP1; CALL BUTTLEVEL; BTFSC MSTOP, 1; GOTO STOPS MOVLW 0X00 MOVWF MSTOP BCF LDET, 0 PIGA DARKLIGHT BTFSC LDET, 0; BSF PORTB, 7 MOVLWFX MOVL MOFL MOX 0 0 Jumla ya kura: 0 | TB, 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 PIGA PWM1ON PIGA PWM2ON BCF PORTD, 0 BSF PORTD, 1 BCF PORTB, 2 BSFPRB GERGI, 1 BSFPRB GERGI, 2 BSFPRB GERGI, 1 BSFPRB GERGI, GHOSA YA RASMI. MSTOP, 1; GOTO STOPS CALL DARKLIGHT BTFSC LDET 0 PORTB, 2 REP5 BANKSEL PIR1 BTFSC PIR1, RCIF GOTO RXDATA GOTO REP5 GOTO CLROE; ********************************* ********** F HABARI ZA MED BCF, RP0 BCF STATUS, RP1 MOVLW 0X00 MOVWF MSTOP BCF LDET, 0; CALL BUTTLEVEL; BTFSC MSTOP, 1; GOTO STOPS PIGA DARKLIGHT BTFSC LDET, 0; BSF PORTB, 7 NORMALMED MOVLFV 040 MOVWF SPEED21 MOVLW 0X99 MOVWF SPEED22 PIGA PWM1ON PIGA PWM2ON BCF PORTD, 0 BCF PORTD, 1 BSF PORTB, 1 BSF PORTB, 2 PIGA SIMU YA SDELAY REP6 PIGA STALL1 BTFSC MSTOP, 0 GOTO STOPS BANKSOP ROPROP GOTO REP6 PLUSEMED MOVLW 0XCF MOVWF SPEED11 MOVLW 0XCC MOVWF SPEED12 MOVLW 0XCF MOVWF SPEED21 MOVLW 0XCC MOVWF SPEED22 PIGA PWM1ON PIGA PWM2ON BCF PORTD, 0 BCF POPB, 0 BCF POPT BANKSEL PIR1 BTFSC PIR1, RCIF GOTO RXDATA BTFSS PORTD, 7 GOTO KAWAIDA GOTO REP7 GOTO CLROE; ******************************* ************ RMED BCF STATUS, RP0 BCF STATUS, RP1 MOVLW 0X00 MOVWF MSTOP BCF LDET, 0; PIGA BUTTLEVEL; BTFSC MSTOP, 1; GOTO STOPS PIGA DARKLIGHT BTFSC LDET, 0; BOFI YA BSF 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 PORTD BOTBORI YA BORA, 1 BSF PORTB, MFANYAKAZI YA 1, BTFSC PIR1, RCIF GOTO RXDATA GOTO REP8 GOTO CLROE; *************************************** **** LMED BCF STATUS, RP0 BCF STATUS, RP1 MOVLW 0X00 MOVWF MSTOP BCF LDET, 0; CALL BUTTLEVEL; BTFSC MSTOP, 1; GOTO STOPS PIGA DARKLIGHT BTFSC LDET, 0; BSF PORTB, 7 MOVLWV 040 SPEED12 MOVLW 0XFF MOVWF SPEED21 MOVLW 0X99 MOVWF SPEED22 PIGA PWM1ON PIGA PWM2ON BSF PORTD, 0 BCF PORTD, 1 BSF PORTB, 1 BCF PORTB, 2 REP9; PIGA STALL1; REP9 GOTO CLROE; ********************************************** STATUS YA BMED BCF, 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 MOVLW 0XFF MOVWF SPEED11 MOVLW 0X7F MOVWF SPEED12 MOVLW 0XFF MOVWF SPEED21 MOVLW 0X7F MOVWF SPEED22 PIGA PWM1ON PIGA PWM2ON BSF PORTD, 0 BSF PORTD, 1 BCF PORTB, 1 BCF PORTB, 2 REP10 CALL STOP1 REP10 GOTO CLROE;, RP0 BCF STATUS, RP1 MOVLW 0X00 MOVWF MSTOP BCF LDET, 0 BSF MSTOP, 4; CALL BUTTLEVEL; BTFSC MSTOP, 1; GOTO STOPS PIGA DARKLIGHT BTFSC LDET, 0; BSF PORTB, 7 MOVLW 0FEFV MOFW MOFFV MOFFX 0FFV MOFFX MOVWF SPEED21 MOVLW 0X7F MOVWF SPEED22 SIMU PWM1ON SIMU PWM2ON BCF PORTD, 0 BCF PORTD, 1 BSF PORTB, 1 BSF PORTB, 2 SIMU sdelay NORMALFAST MOVLW 0XCF MOVWF SPEED11 MOVLW 0XCC MOVWF SPEED12 MOVLW 0XCF MOVWF SPEED21 MOVLW 0XCC MOVWF SPEED22 SIMU PWM1ON SIMU PWM2ON BCF PORTD, 0 BCF PORTD, 1 BTFSC LDET, 0 BSF PORTB, 7 BSF PORTB, 1 BSF PORTB, 2 REP11 PIGA STALL1 BTFSC MSTOP, 0 GOTO INAACHA BENSISI PIR1 BTFSC PIR1, RCIF GOTO RXDATA NOP BTFSS PORTD 7, AST MOVLW 0XCF MOVWF SPEED11 MOVLW 0XFF MOVWF SPEED12 MOVLW 0XCF MOVWF SPEED21 MOVLW 0XFF MOVWF SPEED22 PIGA PWM1ON PIGA PWM2ON BCF PORTD, 0 BCF PORTD, 1 BSFOPPRBB, 1 BSFPRB RAS, 1 BSFOPBORI YA RASMI, 1 BASILI YA BORA, 1, RCIF GOTO RXDATA BTFSS PORTD, 7 GOTO NORMALFAST GOTO REP12 GOTO CLROE; *************************************** ******** HALI YA RFAST BCF, RP0 BCF STATUS, RP1 MOVLW 0X00 MOVWF MSTOP BCF LDET, 0; PIGA BUTTLEVEL; BTFSC MSTOP, 1; GOTO STOPS CALL DARKLIGHT BTFSC LDET, 0; BSF PORTB, 7 MOVLWFXX 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 STOP GOTO REP13 GOTO CLROE; STATUS, RP0 BCF STATUS, RP1 MOVLW 0X00 MOVWF MSTOP BCF LDET, 0; CALL BUTTLEVEL; BTFSC MSTOP, 1; GOTO STOPS PIGA GIZA KIWANGO BTFSC LDET, 0; BSF PORTB, 7 MOVLW 0XFF MOVWF SPEED11 MOVLW 0X66 MOVWF SPEED12 MOVLW 0XFF MOVWF SPEED21 MOVLW 0X99 MOVWF SPEED22 PIGA PWM1ON PIGA PWM2ON BSF PORTD, 0 BCF PORTD, MFRB 1FFB, 1 BSF PV, MFWILI YA 1 0XEF MOVWF SPEED21 MOVLW 0XB3 MOVWF SPEED22 PIGA PWM1ON PIGA PWM2ON BSF PORTD, 0 BCF PORTD, 1 BSF PORTB, 1 BCF PORTB, 2 REP14 PIGA SIMU1 BTFSC MSTOP, 0 GOTO STOPS BANKSROP GIRBODI ****************************************** HATUA YA BFAST BCF, RP0 STATUS ya BCF, RP1 MOVLW 0X00 MOVWF MSTOP BCF LDET, 0; PIGA BUTTLEVEL; BTFSC MSTOP, 1; GOTO STOPS PIGA DARKLIGHT BTFSC LDET, 0; BSF PORTB, 7 MOVLW 0XDF MOVWF SPEED11 MOVLW 0X99 MOVFV MOVFW MOXFX MOVFW 0X99 MOVFX PWM2ON BSF PORTD, 0 BSF PORTD, 1 BCF PORTB, 1 BCF PORTB, 2 PIGA SIMU SELAY MOVLW 0XEF MOVWF SPEED11 MOVLW 0X66 MOVWF SPEED12 MOVLW 0XEF MOVWF SPEED21 MOVLW 0X66 MOVWFP PWMPWMWWWFWM1W2W2WWAPWASKA 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; ************* ***************************** HCLOSE HALI YA BCF, RP0 BCF STATUS, RP1 MOVLW 0X00 MOVWF MSTOP BCF LDET, 0; PIGA 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 GOTSC STOPS, GOTO STOPS PIGA SIMU SDELAY PIGA STALL2 BTFSC MSTOP, 2 GOTO STOPS BANKSEL PIR1 BTFSC PIR1, RCIF GOTO RXDATA GOTO REP16 GOTO CLROE; *****************************., 0; BSF PORTB, 7 BTFSC PORTD, 4 GOTO STOPS BCF PORTD, 2 BSF PORTD, 3 REP17 BTFSC PORTD, 4 GOTO STOPS CALL SDELAY PIGA STALL2 BTFSC MSTOP, 2 GOTO ANAACHA BANKSEL PIR1 BTFSC PIR1, RCIF GOT, RCIF GOT GOTO CLROE; RP0 BCF STATUS, RP1 MOVLW 0X00 MOVWF MSTOP BCF LDET, 0; PIGA BUTTLEVEL; BTFSC MSTOP, 1; GOTO STOPS CALL DARKLIGHT BTFSC LDET, 0; BSF PORTB, 7 BTFSC PORTC, 4 GOTO STOPS BCF P18 BTFSC PORTC, 4 GOTO STOPS BANKSEL PIR1 BTFSC PIR1, RCIF GOTO RXDATA GOTO REP18 GOTO CLROE; ******************************* ************ HALI YA BOFU YA BOFU, RP0 BCF STATUS, RP1 MOVLW 0X00 MOVWF MSTOP BCF LDET, 0; PIGA BUTTLEVEL; 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; ***** ************************ 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; BANKSEL OPTION_REG; BSF OPTION_REG, 3; BSF OPTION_REG, 3; BSF;, 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;, 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 STO, 0 Simu ya SDELAY LFC1 NOP PIGA LFC2 NOP MOVF LR2, 0 SUBWF LR1, 0 BTFSC STATUS, C GOTO LR2G LR1G BCF STATUS, RP0 BCF STATUS, RP1 MOVLW 0X00 MOVWF MSTOP; 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; PIGA SIMU; 0; 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 PIGA LFC1 NOP PIGA LFC2 NOP MOVF LR2, 0 SUBW LFR, 0 SUBWF LOT2, 0 SUBWF LOT2 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 SPVED MOVL MOVL FWDF 0 PORTD, 1 BCF PORTB, 1 BSF PORTB, 2 LR2GREP; PIGA SIMU1; BTFSC MSTOP, 0; GOTO STOPS BANKSEL PIR1 BTFSC PIR1, RCIF GOTO RXDATA PIGA LFC1 NOP PIGA LFC2 NOP MOVF LR2, 0 SUBWF, 0 SUBWF, 0 SUBWF REPLF PIGA LFC1 NOP PIGA LFC2 NOP MOVF LR2, 0 SUBWF LR1, 0 BTFSC STATUS, C GOTO LR2GREP GOTO REPLF MBELE BCF STATUS, RP0 BCF STATUS, RP1 MOVLW 0X00 MOVWF MSTOP; SPEED11 MOVLW 0X99 MOVWF SPEED12 MOVLW 0XFF MOVWF SPEED21 MOVLW 0X99 MOVWF SPEED22 PIGA PWM1ON PIGA PWM2ON BCF PORT D, 0 BCF PORTD, 1 BSF PORTB, 1 BSF PORTB, 2 PIGA SDELAY FROREP; PIGA SIMU1; BTFSC MSTOP, 0; GOTO STOPS BANKSEL PIR1 BTFSC PIR1, RCIF GOTO RXDATA; PIGA LDIN; BTFSC MSTOP, 3; GOTO NOP PIGA 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 CALL PWM1ON CF PWMTDON PALL PWMTDON PALL PWMTDON, PALL PWMTDON 1 PIGA SIMU YA SDELAY STOPA BCF STATUS, RP0 BCF STATUS, RP1 BCF PORTB, 1 BCF PORTB, 2 BCF PORTB, 6 BTFSS LDET, 0; 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 HALI YA BCF, 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 Converst MOVF ADRESH, 0 SUBLW 0X70 BTFSS STATUS, C BSF MSTOP, 0 BCF0 STP, ST BCF0 STP, ST BCF0 STP, ST BCF0 STP, RF01 STP, ST BCF0 STP, RF01 STP, STB, STC STS, STFP STP, STB, STC STST, STB STRF, STFP STP, STBFST STP, STB ni kampuni ya Ubelgiji, iliyoko 2, Bldg. 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 Converst MOVF ADRESH, 0 SUBLW 040 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 STUS STP, STB RB 0, 0 HALI YA BTFSS, C GOTO BL1 GOTO BL2 BL1 BSF MSTOP, 1 BSF PORTB, 6 BL2 RUDISHA DARKLIGHT 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 Converst MOVF ADRESH, 0 SUBLW 0XEE BTFSS STATUS, C BSF PORTBBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX RXXRRXXXX BCF ADCON0, 7 BSF ADCON0, 6 BSF ADCON0, 0 BSF ADCON0, NENDA WAITADC BTFSC ADCON0, GO GOTO WAITADC BCF STATUS, RP1 BCF STATUS, RP0 RETURNPWM1ON BANKSEL PR2 MOVLW 0XFF MOVWFS PR2 BC 0 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 T2C2 TFCB2T2B2 TFCB2T2B2T2B2T2B2F2F2T1F2F2T2F2F1F1F2F2F1F2F1F2F2F1F2F1F2F1F2F2F2RF2, TFKRFB2F2F2F2F2F1F1F2F2F2F1F1F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2) 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 RFF, RP1 MOVLW 0XF0 MO 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 HALI YA, RP1 BCF HALI YA, 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 PR2 BCF ST0, 0 5 BCF STATUS, RP0 BCF STATUS, RP1 CALL Converst MOVF ADRESH, W ANDLW 0XF0 MOVWF LR1 BCF STATUS, RP0 BCF STATUS, RP1 RETURN LFC2 BANKSEL ADCON0 BCF ADCON0, 3 BSF ADCON ST0, 4 BSF ADPON, 0 BSF ADCON, 0 BSF RP1 CALL Converst 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 STUS STB, RP0 BC, RP0 BC. HALI YA 0X4C BTFSC, C GOTO COMP4 BSF MSTOP, 3 COMP4 BCF STATUS, RP0 BCF STATUS, RP1 KURUDISHA 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 L2 G2 XL3 KURUDISHA NOP NOPEND
Zawadi ya Pili katika Mashindano ya Roboti ya Maagizo na RoboGames
Ilipendekeza:
Mchezo wa Mwamba wa Arduino: Hatua 4
Mchezo wa Rocker Arduino: Huu ni mchezo wa Arduino, kuna taa 11 za LED, taa za LED zitaangaza kwa muundo. Wakati mwangaza wa katikati unaangaza, bonyeza kitufe. Una maisha matatu, kila wakati bonyeza kitufe wakati taa haiko katikati unapoteza maisha. Baada ya
Mkasi wa Karatasi ya Mwamba AI: Hatua 11
Rock Paper Scissor AI: Umewahi kujisikia kuchoka peke yake? Wacha tucheze mwamba, karatasi, na mkasi dhidi ya mfumo wa maingiliano unaotumiwa na akili
Mikasi ya Karatasi ya Mwamba: Hatua 10
Mikasi ya Karatasi ya Mwamba: Kusudi: Baada ya kumaliza hii, utajifunza jinsi ya kutengeneza mchezo rahisi wa Rock, Mikasi ya Karatasi kutoka mwanzoni ukitumia Code.org. Vifaa / Mahitaji yanahitajika: Uelewa wa kimsingi wa sintaksia ya Javascript, kompyuta, akaunti ya Code.org
Mchanganuzi wa Sampuli ya Mwamba: Hatua 4
Mchanganuzi wa Sampuli ya Mwamba: Mchanganuzi wa Sampuli ya mwamba hutumiwa kutambua na kuchambua aina za sampuli za miamba kwa kutumia mbinu laini ya kutetemeka kwa nyundo. Ni njia mpya katika kubainisha sampuli za mwamba. Ikiwa kimondo au sampuli yoyote ya mwamba haijulikani iko, mtu anaweza kukadiria
Mwili wa Buggy ya Mwamba kwa RedCat Gen7: Hatua za 9 (na Picha)
Mwili wa Buggy Rock kwa RedCat Gen7: Inspiration3D Vifaa vya kuchapisha na hata miili yote ni maarufu sana kati ya jamii ya RC, haswa katika aina ya RC Crawlers. Mimi na wengine tumetoa kila aina ya miradi ya bure, lakini kisichosikika ni kwa wazalishaji kuachilia