INHOUDSOPGAWE:
- Stap 1: Ontwerp die projek
- Stap 2: Kies die toestelle en komponente
- Stap 3: Die mikrobeheerder
- Stap 4: Skryf die rekenaarprogram
- Stap 5: Bou die liggaam
- Stap 6: Bou die draadlose stroombaan
- Stap 7: Integreer
- Stap 8: Programkode vir mikrokontroleerder
Video: Die rots: 8 stappe
2024 Outeur: John Day | [email protected]. Laas verander: 2024-01-30 07:28
Hierdie robot word beheer deur 'n visuele basiese program (deur die seriële poort) en kan in drie verskillende snelhede beweeg deur 'n pulswydte gemoduleerde (PWM) sein wat deur 'n PIC mikrobeheerder (16F877) gegenereer word. Die robot kan in twee modusse gebruik word, "normale beheer" en "ligte spoorsnyer". In die normale beheermodus kan die robot binne 150 m voorwerpe van 3 - 18 cm van plek na 'n ander vervoer. terwyl dit in die ligspoormodus die lig in 'n donker kamer volg. Baie sensors is gebruik, soos ligsensors; kantelsensor, stallstroomwaarneming, batteryniveau -waarneming en 'n paar eindskakelaars en aanraaksensors wat in die hand gebruik word. Dit kan sy spoed konstant hou as dit op 'n heuwel gaan (gekantel) en skakel die lig outomaties aan as dit donker word. Om die IC's veilig te hou, ontkoppel dit die stroom as dit vassteek, en die hand stop as daar iets vasgehou word. 4 GS -motors is gebruik deur 'n PIC -mikrobeheerder 16F877 en 3 motorbestuurderbane. Dit duur ongeveer 4 maande en kos ongeveer $ 600
Stap 1: Ontwerp die projek
in die beginfase is 'n ontwerp van die projek verskaf. hoofsaaklik die definisie van die blokdiagram; sien die figuur.
'N Meer gedetailleerde stroombaandiagram is op hierdie stadium nodig, maar om dit te vergemaklik, was die belangrikste modules geïdentifiseer: 1. Mikrobeheerder 2. Sensors 3. Motors 4. Draadlose stroombaan 5. PC -program. 'N 3D -ontwerp is ook gedoen, sien die figuur.
Stap 2: Kies die toestelle en komponente
In hierdie stadium moet die ontwerper die toestelle en komponente kies wat nodig is om die robot te bou.
Dit sluit in: die draadlose stroombaan (MAX232, LM331, FM-sender en ontvanger-modules), motors (4 GS-motors), motorbestuurderbaan (H-brug), die mikrobeheerder PIC (16F877), battery, spanningsreguleerders (MC7805), mikroskakelaars, Fotoresistors, Kantelsensor … ens. Dit is belangrik om die berekening van hierdie toestelle te verstaan en hoe dit saamwerk.
Stap 3: Die mikrobeheerder
Hierdie stap is die belangrikste stap. Aan die begin moet die kodes wat vanaf die OBK ontvang en gestuur word, geïdentifiseer word.
Verbind die komponente met die toepaslike penne van die PIC, en programmeer die mikrobeheerder. Dit kan nodig wees om klein stroombane te bou met behulp van die reguleerders, weerstande, sensors … ens.
Stap 4: Skryf die rekenaarprogram
Die program is op visuele basis geskryf.
Die kommunikasie is tot stand gebring deur middel van die RS-232. Gebruik MSComm om die data na die mikrobeheerder te stuur deur die instellings op te stel (poortnommer, baud -tempo, pariteitsaantal databits, stopbits). Ek het 8-bis data gebruik met een stop bit en pariteit teen 'n baud rate van 9600 bps.
Stap 5: Bou die liggaam
'N Goeie ontwerp van die liggaam is belangrik. Sien ook die figuur.
die robot is gebou nadat hy verseker het dat die programme goed werk. Hierdie stap kan ook gedoen word voordat u programmeer.
Stap 6: Bou die draadlose stroombaan
Die bou van die draadlose kring kan onafhanklik wees. In die beginfase het ek 'n draad gebruik om die rekenaar met die robot te verbind, en nadat die robot klaar was, is die draadlose kring geïntegreer.
Stap 7: Integreer
Dit is die oomblik toe ons ons komponente geïntegreer het en die robot getoets het.
Stap 8: Programkode vir mikrokontroleerder
; **************** FINALE ******************************** lys p = 16f877 bevat radix decidlocs "V" << 8 | "1"; Weergawe nr. Konfig _CP_OFF & _PWRTE_OFF & _WDT_OFF & _XT_OSC; ********** hoofveranderlike ************************** cblock 0x20; begin van bank 0 ram gebied INPUT_VAR L1 L2 X SPEED11 SPEED12 SPEED22 SPEED22 MSTOP LDET LR1 LR2 endc; ********** begin van die hoofprogram *************** begin 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 IS I/O MOVWF TRISC MOVW TRISD MOVLW 0X07; PORT E IS 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 BTFSCST, 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 GOTO WAIT1, RCIF GOTO WAIT 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 BTFSC LDET, 0 BSF 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 0; BEWEEG VOORUIT STADIG SUBLW 0X66 BTFSC STATUS, Z GOTO FSLOW MOVF INPUT_VAR, 0; BEWEG REGS SLAG SUBLW 0X72 BTFSC STATUS, Z GOTO RSLOW MOVF INPUT_VAR, 0; BEWEG LINKER SLAG SUBLW 0 X6C BTFSC STATUS, Z GOTO LSLOW MOVF INPUT_VAR, 0; BEWEEG TERUG NAAR LAAG SUBLW 0X62 BTFSC STATUS, Z GOTO BSLOW MOVF INPUT_VAR, 0; SKUEF VOORUIT MEDIUM SUBLW 0X46 BTFSC STATUS, ZVOTO FMX, ZVOTO FMX, ZVOTO FMX, ZVOTO FMX, ZVOTO FMX, ZVOTO FMX, ZVOTO FMX, ZVOTO FMX, ZVOTO FMX, ZVOTO FMX, ZVOTO FMX, ZVOTO FMX, ZVOTO FMX, ZVOTO FMX, ZVOTO FMX, ZVOTO FMX, ZVOTO FMX, ZVOTO FMX, ZVOTO FMX, ZVOTU FMX STATUS, Z GOTO RMED MOVF INPUT_VAR, 0; SKUIF LEFT MEDIUM SUBLW 0X4C BTFSC STATUS, Z GOTO LMED MOVF INPUT_VAR, 0; BEWEG TERUG MEDIUM SUBLW 0X42 BTFSC STATUS, Z GOTO BMED MOVW Z GOTO FFAST MOVF INPUT_VAR, 0; MOVE RIGHT FAST SUBLW 0X57 BTFSC STATUS, Z GOTO RFAST MOVF INPUT_VAR, 0; LEFT LINKS SNEL SUBLW 0X56 BTFSC STATUS, Z GOTO LFAST MOVF INPUT_VARW, FOTO STRAAT, FOTO 5 BFAST MOVF INPUT_VAR, 0; HAND BESLOTE SUBLW 0X43 BTFSC status Z GOTO HCLOSE MOVF INPUT_VAR, 0; hand oop SUBLW 0X4F BTFSC status Z GOTO HOPEN MOVF INPUT_VAR, 0; hand SUBLW 0X75 BTFSC status Z GOTO Hup MOVF INPUT_VAR, 0; HAND ONDER 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; CALL BUTTLEVEL; BTFSC MSTOPO, 1; GFSOTO 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 PWRP, PORTBURG 1 PORTBURG 1 PORTBURG 1 PORTBURG 1 PORTBURG 1 PORTBURG 1 PORTBURG PORT 2, 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 CALL DARKLIGHT BTFSC LDET, 0; BSF PORTB, 7 MOVLW 0XW MOVW 0XCF MOVWF SPEED21 MOVLW 0X66 MOVWF SPEED22 Oproep PWM1ON Oproep 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; CALL 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 PWM2ON BCF PORTD, 0 BSF PORTD, 1 BCF PORTB, 1 BSF PORTB, 2 REP35 BANKSEL PIR1 BTFSC PIR1, RCIF GOTO RXDATA GOTO REP35 GOTO CLROE; * *************************** BSLOW BCF STATUS, RP0 BCF STATUS, RP1 MOVLW 0X00 MOVWF MSTOP BCF LDET, 0; CALL BUTTLEVEL; BTFSC MSTOP, 1; GOTO STOPS BEL DARKLIGHT BTFSC LDET, 0; BSF PORTB, 7 MOVLW 0XCF MOVWF SPEED11 MOVLW 0X99 MOVWF SPEED12 MOVLW 0XCF MOVWF SPEED21 MOVLW 0X99 MOVWF SPEED22 CALL 1 PALLER 1 POSER 22 PALLES 1 PORTES BOSS 1 PORTES BOSS 1 PORTES 2 PURS 2 PURS 2 PURS 2 PORT 2 PURS 2 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 MOVLWW MOXLWX 0X MOVWF SPEED21 MOVLW 0X99 MOVWF SPEED22 SKAKEL PWM1ON SKAKEL PWM2ON BCF PORTD, 0 BCF PORTD, 1 BSF PORTB, 1 BSF PORTB, 2 OPROEP SDELAY REP6 SKAKELSTAL1 BTFSC MSTOP, 0 GOTO STOPS BANKSEL PORTO GOTO REP6 PLUSEMED MOVLW 0XCF MOVWF SPEED11 MOVLW 0XCC MOVWF SPEED12 MOVLW 0XCF MOVWF SPEED21 MOVLW 0XCC MOVWF SPEED22 SKAKEL PWM1ON SKAKEL PORT, BEST PORT, BEST PORT, BEST PORT, BEST PORT, PORT BONT 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; CALL 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 SKAKEL PWM1ON SKAKEL PWM2ON BCF PORTD, 0 BSF PORTBON, 1 BSF PORTBON, 1 BSF PORTBON, 1 BSF PORTBON, 1 BSF PORTBON, 1 BCF PORTBON, 1 BCFPORT 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 CALL DARKLIGHT BTFSC LDET, 0; BSF PORTB, 7 MOVLW 0XFF MOVW SPEED12 MOVLW 0XFF MOVWF SPEED21 MOVLW 0X99 MOVWF SPEED22 SKAKEL PWM1ON BEL PWM2ON BSF PORTD, 0 BCF PORTD, 1 BSF PORTB, 1 BCF PORTB, 2 REP9; SKAKEL STALL1; BTFSC MOTOP, BOTO, GOTO REP9 GOTO CLROE; ***************************************** BMED 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 MOVLW 0XFF MOVWF SPEED11 MOVLW 0X7F MOVWF SPEED12 MOVLW 0XFF MOVWF SPEED21 MOVLW 0X7F MOVWF SPEED22 SKAKEL PWM1ON SKAKEL PWM2ON BSF PORTD, 0 BSF PORTD, 1 BCF PORTB, 1 BCF PORTBO, 2 REP10 BALLOTO, 2 REP10 BALLOTO, 2 REP10 BALLOTO, 2 BOTS STOPPEN, BOTS STOP, 2 BESTUUR BOTS, BOTS STOP, 2 BESTUUR BOTS, BOTS STOP, 2 BESTUUR POTS, BOTS STOP, 2 BESTUUR BOTS, GELUKKE BESTUUR, 2 VERSLAGSTOFFE BOTSTOP REP10 GOTO CLROE; ***************************************** FFAST BCF -STATUS, RP0 BCF STATUS, RP1 MOVLW 0X00 MOVWF MSTOP BCF LDET, 0 BSF MSTOP, 4; CALL BUTTLEVEL; BTFSC MSTOP, 1; GOTO STOPS CALL DARKLIGHT BTFSC LDET, 0; BSF PORTB, 7 MOVLW 0XEF MOVWF MOVWFX12 MOVWF SPEED21 MOVLW 0X7F MOVWF SPEED22 CALL PWM1ON CALL PWM2ON BCF PORTD, 0 BCF PORTD, 1 BSF PORTB, 1 BSF PORTB, 2 CALL SDELAY NORMALFAST 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 BTFSC LDET, 0 BSF PORTB, 7 BSF PORTB, 1 BSF PORTB, 2 REP11 CALL STALL1 BTFSC MSTOP, 0 GOTO STOPPS BANKSEL PIR1 BTFSC PIR1, RCIF GOTO RXDATA NOP BTFSS PORTP, 7 GOTO AST MOVLW 0XCF MOVWF SPEED11 MOVLW 0XFF MOVWF SPEED12 MOVLW 0XCF MOVWF SPEED21 MOVLW 0XFF MOVWF SPEED22 SKAKEL PWM1ON SKAKEL PWM2ON BCF PORTD, 0 BCF1 PORTBURG, 1 BSF1 PORTBURG, 1 BSF1 PORTBURG, 1 BSF1 PORTBURG, 1 BSF1 PORTBURG, 1 BSF1 PORTBURG, 1 BSF1 PORTBURG, 1 BSF1 PORTBURG, 1 BSF1 PORTBURG, 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; CALL BUTTLEVEL; BTFSC MSTOP, 1; GOTO STOPS CALL DARKLIGHT BTFSC LDET, 0; BSF PORTB, 7 MOVLWX SPEED11 MOVLW 0X99 MOVWF SPEED12 MOVLW 0XFF MOVWF SPEED21 MOVLW 0X66 MOVWF SPEED22 SKAKEL PWM1ON BEL PWM2ON BCF PORTD, 0 BSF PORTD, 1 BCF PORTB, 1 BSF PORTBOS, 1 BTS1 PORTO, 2 REP13 BESTUUR, BOTS PORTO, 2 REP13 BESTUUR, BOTS PORTO, 2 REP13 BESTUUR, BOTS PORTO, 2 REP13 BESTUUR PORTBAL, 2 REP13 BESTUUR PORTBAL, 2 REP13 BESTUUR PORTBALS GOTO REP13 GOTO CLROE; ***************************************** LFAST 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 MOVLW 0XFF MOVWF SPEED11 MOVLW 0X66 MOVWF SPEED12 MOVLW 0XFF MOVWF SPEED21 MOVLW 0X99 MOVWF SPEED22 CALL PWM2ON BSV PVD 0XEF MOVWF SPEED21 MOVLW 0XB3 MOVWF SPEED22 Oproep PWM1ON SKAKEL PWM2ON BSF PORTD, 0 BCF PORTD, 1 BSF PORTB, 1 BCF PORTB, 2 REP14 SKAKELSTAL1 BTFSC MSTOP, 0 GOTO STOP, BOTSKOPPER BOTSKOPPER, BOTSKOPPER BANKSEL1, BOTSKOPPER BOTSKOPPER, GOTO STOPPIES BANK *************************************** BFAST 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 MOVLW 0XDF MOVWF SPEED11 MOVWW MOVWW MOVWW 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 MOVWFWE SP2 PORTD, 0 BSF PORTD, 1 BCF PORTB, 1 BCF PORTB, 2 REP15 Oproepstalletjie 1 BTFSC MSTOP, 0 GOTO STOPS 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; CALL BUTTLEVEL; BTFSC MSTOP, 1; GOTO STOPS CALL DARKLIGHT BTFSC LDET, 0; BSF PORTB, 7 BTFSC PORTD, 5 GOTO STOPS BTFSC PORTD, 6 GOTO STOPPS 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; CALL 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 PIR1, RCIFOTO GAAN CLROE; ****************************************** HUP 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 BTFSC PORTC, 4 GOTO STOPS BCF PORTC, 4 GOTO STOPS BCF PORTC 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; CALL 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 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 OPTION_, 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; BCF INTCON, PCF BANK, 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; MOEP MOVW, MOVLVO, MOVLVO, MOVLVO, MOVLVO, MOVLVO, MOVLVO, MOVLVO, MOVLOVO, MOVLVO, MOVLVO, MOVLVO, MOVLOVO, MOVLOVO, MOVLOVO, MOVLOVO, MOVLOVO 0X66 MOVWF SPEED12 MOVLW 0XFF MOVWF SPEED21 MOVLW 0X99 MOVWF SPEED22 Oproep PWM1ON BEL PWM2ON BSF PORTD, 0 BCF PORTD, 1 BSF PORTB, 1 BCF PORTB, 2 LR1GREP; CALL STALLO; 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 LFS 2 REPLF LR2G BCF STATUS, RP0 BCF STATUS, RP1 MOVLW 0X00 MOVWF MSTOP; SKAKEL BUTTLEVEL; BTFSC MSTOP, 1; GAAN STOP MOVLW 0XFF MOVWF SPEED11 MOVLW MOVW MOVW MOVW MOVW MOVW MOVW MOVW MOVW MOVW MOVW MOVW MOVW MOVW MOVO MOVO MOVO MOVO MOVO MOVO MOVO MOVO MOVO MOVO MOVO MOVLOO 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 SUBWF LFS 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; SPEED11 MOVLW 0X99 MOVWF SPEED12 MOVLW 0XFF MOVWF SPEED21 MOVLW 0X99 MOVWF SPEED22 Oproep PWM1ON Oproep 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; GOTO STOP NOP CALL LFC2 NOP MOVF LR2, 0 SUBWF LR1, 0 BTFSC STATUS, Z GOTO FROREP GOTO REPLF GOTO CLROE; ************************** ***************** STOP BTFSS MSTOP, 4 GOTO STOPA MOVLW 0XCF MOVWF SPEED11 MOVLW 0XB3 MOVWF SPEED12 MOVLW 0XCF MOVWF SPEED21 MOVLW 0XB3 MOVWF SPEED22 CALL PALL2 PALLMOTOR CALL POND02 CALL PALL2 PALLER 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 PORT 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 Oproepomskakeling MOVF ADRESH, 0 SUBLW 0X70 BTFSS STATUS, C BSF MSTOP, RTCF RST 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 SUBL 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 STATUS, RBV 0 BTFSS STATUS, C GOTO BL1 GOTO BL2 BL1 BSF MSTOP, 1 BSF PORTB, 6 BL2 RETURN 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 Oproep MOVF ADRESH, 0 SUBLW 0XEE BTFSS STATUS, C BSF PORTBONNE, RETOON ADVONS, RETOON ADVONS, RETOON ADVONSIE 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 MOVW MOVWF CCP1CON MOVF SPEED12, 0 MOVWF CCPR1L BSF STATUS, RP0 BCF STATUS, RP1 MOVLW 0XF0 MOVWF TRISC BCF STATUS, RP1 BCF T2CON, T2CON, T2CON 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 MOVLF 0XF0 MOVL 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 status RP1 BCF status 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 BANKS ADC, R0 BCF, AD2, R0 BCF 5 BCF STATUS, RP0 BCF STATUS, RP1 Oproepomskakeling MOVF ADRESH, W ANDLW 0XF0 MOVWF LR1 BCF STATUS, RP0 BCF STATUS, RP1 RETURN LFC2 BANKSEL ADCON0 BCF ADCONC, 5 BSF ADCON0, 5 BSF ADCON0, 5 BSF ADCON0 RP1 Oproep omskakel 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 STV, RP0 ADV 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 MOVF WX XL3 RETURN NOP NOPEND
Tweede prys in die Instructables en RoboGames -robotwedstryd
Aanbeveel:
Konfigurasie van die AVR -mikrobeheerder. Skep en laai die LED -knipperprogram in die flitsgeheue van die mikrokontroleerder op: 5 stappe
Konfigurasie van die AVR -mikrobeheerder. Skep en laai die LED -knipperprogram in die flitsgeheue van die mikrokontroleerder: In hierdie geval sal ons 'n eenvoudige program in C -kode skep en dit in die geheue van die mikrokontroleerder verbrand. Ons sal ons eie program skryf en die hex -lêer saamstel, met behulp van die Atmel Studio as die geïntegreerde ontwikkelingsplatform. Ons sal die sekering van twee instel
Hoe om die veiligheid van die meeste blokkeerders aan die kant van die bediener te omseil: 3 stappe
Hoe om die veiligheid van die meeste webblokkers op die bediener te verlig: dit is my eerste instruksie, so hou my in gedagte: Ok, ek sal u vertel hoe u die webblokkers wat ek in skole gebruik het, kan omseil. Al wat u nodig het, is 'n flash drive en 'n paar sagteware aflaai
Instruksies vir die voltooiing van die opmaak van die baanskyfontwerp vir die opheffing/verlaging van die middelste voetsteun op motorwielstoele: 9 stappe (met foto's)
Instruksies vir die voltooiing van die opmaak van die baanskyfontwerp vir die opheffing/verlaging van die middelste voetsteun op motorwielstoele: die middelste voetsteunhysers moet goed onder die sitplek geberg word en laer om te ontplooi. 'N Meganisme vir die onafhanklike werking van die opberging en ontplooiing van voetsteun is nie ingesluit by rolstoele op die mark nie, en PWC -gebruikers het die behoefte uitgespreek
Waterdigte luidsprekers wat dryf - " Dit dryf, klink en dit maak die notas rots! &Quot;: 7 stappe (met prente)
Waterdigte luidsprekers wat dryf - " It Floats, It Totes and It Rocks the Notes! ). Ons sal langs die rivier dryf, of lyne aan die oewer vasmaak sodat ons vlotte reg langs ons kampterrein bly. Almal h
VUIL ROTS - Elimineer onherwinbare asblik: 8 stappe
VUIL ROTS - Elimineer onherwinbare asblik: Om 'n asblik te maak, word 'n sak eers uit visnet gestik. Dit is gevul met asblik en met sement gepleister. Die gevolglike skulpe is uniek van vorm en lyk baie natuurlik. Vullisreste is 'n esteties aangename en opbouende