Sadržaj:
- Korak 1: Dizajnirajte projekt
- Korak 2: Odaberite uređaje i komponente
- Korak 3: Mikrokontroler
- Korak 4: Napišite PC program
- Korak 5: Izgradite tijelo
- Korak 6: Izgradite bežično kolo
- Korak 7: Integrirajte
- Korak 8: Programski kod mikrokontrolera
Video: The Rock: 8 koraka
2024 Autor: John Day | [email protected]. Zadnja izmjena: 2024-01-30 08:09
Ovim robotom upravlja vizualni osnovni program (preko serijskog porta), a može se kretati u tri različite brzine pomoću signala s moduliranom širinom impulsa (PWM) koji generira PIC mikrokontroler (16F877). Robotom se može upravljati u dva načina rada, "normalna kontrola" i "praćenje svjetla". U normalnom načinu upravljanja robot može nositi predmete veličine od 3 - 18 cm od mjesta do drugog unutar 150 m. budući da u načinu praćenja svjetla prati svjetlo u mračnoj prostoriji. Korišteno je mnogo senzora, poput svjetlosnih senzora; senzor nagiba, osjetljivost struje zastoja, mjerenje nivoa baterije, te neki krajnji prekidači i senzori za dodir koji se koriste u ruci. Može održavati konstantnu brzinu kada ide na brdo (nagnuto) i automatski pali svjetlo kada postane mračno. Također radi zaštite IC -a, on isključuje struju kada se zaglavi i ruka prestane držati nešto.4 Koristili su se istosmjerni motori kontrolirani PIC mikrokontrolerom 16F877 i 3 sklopa upravljačkih programa motora. Trajalo je oko 4 mjeseca i košta oko 600 USD
Korak 1: Dizajnirajte projekt
u početnoj fazi je dat dizajn projekta. uglavnom, definiranje blok dijagrama; vidi sliku.
U ovoj fazi potreban je detaljniji dijagram kola, međutim, kako bi se to olakšalo, identificirani su glavni moduli: 1. Mikrokontroler 2. Senzori 3. Motori 4. Bežično kolo 5. Program za PC. Urađen je i 3D dizajn, pogledajte sliku.
Korak 2: Odaberite uređaje i komponente
U ovoj fazi dizajner bi trebao odabrati uređaje i komponente potrebne za izradu robota.
To uključuje: bežično kolo (MAX232, LM331, FM predajnik i prijemnički moduli), motore (4 istosmjerna motora), krug pokretačkih programa motora (H-most), mikrokontroler PIC (16F877), bateriju, regulatore napona (MC7805), mikroprekidače, Fotootpornici, senzor nagiba … itd. Važno je razumjeti mogućnost izračunavanja ovih uređaja i njihov zajednički rad.
Korak 3: Mikrokontroler
Ovaj korak je najvažniji korak. na početku treba identificirati kodove koji će biti primljeni i poslani od PIC -a.
Počnite povezivati komponente na odgovarajuće pinove PIC -a i programirajte mikrokontroler. To može zahtijevati izgradnju malih kola pomoću regulatora, otpornika, senzora … itd.
Korak 4: Napišite PC program
Program je napisan na basic basic.
Komunikacija je uspostavljena putem RS-232. Korištenje MSComm za slanje podataka mikrokontroleru konfiguriranjem postavki (broj porta, brzina prijenosa, paritetni broj bitova podataka, zaustavni bitovi). Koristio sam 8-bitne podatke s jednim bitom i paritetom pri brzini prijenosa 9600 bps.
Korak 5: Izgradite tijelo
Dobar dizajn tela je važan. Odabirom rasporeda točkova pogledajte sliku.
Robot je izgrađen nakon što se uvjerio da programi dobro rade. Ovaj korak se može uraditi i pre programiranja.
Korak 6: Izgradite bežično kolo
Izgradnja bežičnog kruga može biti neovisna. U početnoj fazi koristio sam žicu za povezivanje računara s robotom, a nakon finalizacije robota integrirano je bežično kolo.
Korak 7: Integrirajte
Ovo je trenutak kada smo integrirali naše komponente i testirali robota.
Korak 8: Programski kod mikrokontrolera
; *************** ZAVRŠNI ******************************** lista p = 16f877 uključuje radix decidlocs "V" << 8 | "1"; Verzija No.config _CP_OFF & _PWRTE_OFF & _WDT_OFF & _XT_OSC; ********** glavna varijabla *************************** cblock 0x20; početak banka 0 ram područje INPUT_VAR L1 L2 X SPEED11 SPEED12 SPEED21 SPEED22 MSTOP LDET LR1 LR2 endc; ********** početak glavnog programa *************** start BSF STATUS, RP0 BCF STATUS, RP1 MOVLW 0X40 MOVWF ADCON1 MOVLW 0XFF; PORT A IS I MOVWF TRISA MOVLW 0X00; PORT C JE I MOVWF TRISB MOVLW 0XF0; TRISD MOVLW 0X07; PORT E IS I MOVWF TRISE BANKSEL OPTION_REG BCF OPTION_REG, T0CS BCF STATUS, RP1 BCF STATUS, RP0; ************************* ******************; ******************************* ******** 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, SPC RCSTA, SPC RCSTA, SPC, OERR GOTO CLROE BANKSEL PIE1, BSF CALL PWM1OFF CALL PWM2OFF CALL DARKLIGHT BTFSC LDET, 0 BSF PORTB, 7RXDATA; BANKSEL RCSTA; BTFSC RCSTA, OERR; 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 ZAUSTAVLJANJE MOVF INPUT_VAR, 0; SVJETLO NA SUBLW 0X4E BTFSC STATUS, Z GOTO LON MOVF INPUT_VAR, 0 FUKT. 0; POKRETITE NAPRIJED SLABO SUBLW 0X66 BTFSC STATUS, Z OGLASITE SPUŠTANJE MOVF INPUT_VAR, 0; POKRETITE DESNO SPORO SUBLW 0X72 BTFSC STATUS, Z OGLASITE USPORITE MOVF INPUT_VAR, 0; KRETITE LIJEVO SPORO X6C BTFSC STATUS, Z OGLAŠAVANJE NISKOG MOVFA INPUT_VAR, 0; POKRETI NAZAD POROČNO SUBLW 0X62 BTFSC STATUS, Z GOTO SLOČI MOVF INPUT_VAR, 0; POMJERI NAPRIJED SREDNJI SUBLW 0X46 BTFVAT SUP. STATUS, Z GOTO RMED MOVF INPUT_VAR, 0; POKRETI LIJEVI SREDNJI SUBLW 0X4C BTFSC STATUS, Z GOTO LMED MOVF INPUT_VAR, 0; POKRENI SREDNJI SUBLW 0X42 BTFSC STATUS, Z GF Z GOTO FFAST MOVF INPUT_VAR, 0; POKRETI DESNO BRZO SUBLW 0X57 BTFSC STATUS, Z GOTO RFAST MOVF INPUT_VAR, 0; POKRETI LIJEVO BRZO SUBLW 0X56 BTFSC STATUS, Z GOTO LFAWT MOVFO, MOVF, VOZI MOVF BFAST MOVF INPUT_VAR, 0; HAND CLOSE SUBLW 0X43 BTFSC STATUS, Z GOTO HCLOSE MOVF INPUT_VAR, 0; HAND OTVOREN SUBLW 0X4F BTFSC STATUS, Z GOTO HOPEN MOVF INPUT_VAR, 0 HVF, HVF, HVF; RUČNO DOLE 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; BTFTST MOTO MSTOP 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 PWM PFDB, RCIF GOTO RXDATA GOTO REP3 GOTO CLROE; *************************************** ** LSLOW BCF STATUS, RP0 BCF STATUS, RP1; TIPKA POZIVA; BTFSC MSTOP, 1; GOTO ZAUSTAVLJANJE MOVLW 0X00 MOVWF MSTOP BCF LDET, 0 POZIV TAMNO SVJETLO BTFSC LDET, 0; BSF PORTB, 7 MOVLWW MOVOVO MOVO WWW MWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWSWWWWWWWWWWWMVWWWXXXXXXXXXXXX 0XCF MOVWF SPEED21 MOVLW 0X66 MOVWF SPEED22 POZIV PWM1ON POZIV PWM2ON BSF PORTD, 0 BCF PORTD, 1 BSF PORTB, 1 BCF POR TB, 2 REP4 BANKSEL PIR1 BTFSC PIR1, RCIF IDE 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 POZIV PWM1ON POZIV PWM2ON BCF PORT **************************** BSLOW BCF STATUS, RP0 BCF STATUS, RP1 MOVLW 0X00 MOVWF MSTOP BCF LDET, 0; CALL BUTTLEVEL; BTFSC MSTOP, 1; GOTO STOPI POZIV DARKLIGHT BTFSC LDET, 0; BSF PORTB, 7 MOVLW 0XCF MOVWF SPEED11 MOVLW 0X99 MOVWF SPEED12 MOVLW 0XCF MOVWF SPEED21 MOVLW 0X99 MOVWFF POP. PORTB, 2 REP5 BANKSELA PIR1 BTFSC PIR1, RCIF IDE RXDATA GOTO REP5 GOTO CLROE; ********************************* ********** F MED BCF STATUS, RP0 BCF STATUS, RP1 MOVLW 0X00 MOVWF MSTOP BCF LDET, 0; DUGMOJ POZIV; BTFSC MSTOP, 1; GOTO ZAUSTAVLJANJE POZIV TAMNO SVJETLO BTFSC LDET, 0; BSF PORTB, 7 NORMALFMWFWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMMWMWMWWMWWMWWMWMWMWMMWMWMWMMMWMMMWMMMWMMMWMMMWMWW, NJEVE MOVWF SPEED21 MOVLW 0X99 MOVWF SPEED22 POZIV PWM1ON POZIV PWM2ON BCF PORTD, 0 BCF PORTD, 1 BSF PORTB, 1 BSF PORTB, 2 POZIV SDELAY REP6 POZIV STALL1 BTFSC MSTOP, 0 GOTO STOPS BOPKS GOTO REP6 PLUSEMED MOVLW 0XCF MOVWF SPEED11 MOVLW 0XCC MOVWF SPEED12 MOVLW 0XCF MOVWF SPEED21 MOVLW 0XCC MOVWF SPEED22 POZIV PWM1ON POZIV PWM2ON BCF PORTFORT, 0 BCF PORTF. 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 POZIV PWM1ON POZIV PWM2ON BCF PORTD, 0 BSF PORTD, 1 BCF POP BTFSC PIR1, RCIF GOTO RXDATA GOTO REP8 GOTO CLROE; ************************************* **** LMED BCF STATUS, RP0 BCF STATUS, RP1 MOVLW 0X00 MOVWF MSTOP BCF LDET, 0; TIPKA POZIVA; BTFSC MSTOP, 1; GOTO STOPS POZIV TAMNO SVJETLO BTFSC LDET, 0; BSF PORTB, 7 MOVLWW MOVWW WWWWWWWWWMWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWV, VIDEO 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; POZIV STALL1; REP9 GOTO CLROE; ***************************************** BMED BCF STATUS, RP0 STANJE BCF, RP1 MOVLW 0X00 MOVWF MSTOP BCF LDET, 0; POZIVNI DUGMO; BTFSC MSTOP, 1; GOTO ZAUSTAVLJA 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, 2 REPT. REP10 GOTO CLROE; ***************************************** FFAST BCF STATUS, RP0 STANJE BCF, RP1 MOVLW 0X00 MOVWF MSTOP BCF LDET, 0 BSF MSTOP, 4; DUGMOJ POZIV; BTFSC MSTOP, 1; GOTO ZAUSTAVLJANJE POZIV TAMNO SVJETLO BTFSC LDET, 0; BSF PORTB, 7 MOVLW 0XW MOVE MOVO MOVE MOVE MOVE MOVE MOVE MOVE MOVE MOVE MOVE MOVE MOVE MOVE 0 MOVE MOVWF SPEED21 MOVLW 0x7f MOVWF SPEED22 CALL PWM1ON CALL PWM2ON BCF PORTD, 0 BCF PORTD, 1 BSF PORTB, 1 BSF PORTB, 2 POZIV 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 POZIV STALL1 BTFSC MSTOP, 0 GOTO STOPS BANKSEL PIR1 BTFSC PIR1, RCIF GOTO RXDATA NOP BTFDS POP AST MOVLW 0XCF MOVWF SPEED11 MOVLW 0XCF MOVWF SPEED21 MOVLW 0XFF MOVWF SPEED22 CALL PWM1ON BTS PORT, 1 BSF, 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 CALL PWM1ON CALL PWM2ON BCF PORTD, 0 BSF PORTB, 2 REF. GOTO REP13 GOTO CLROE; *************************************** LFAST BCF STATUS, RP0 BCF STATUS, RP1 MOVLW 0X00 MOVWF MSTOP BCF LDET, 0; POZIVNI MUTOPLAST; BTFSC MSTOP, 1; GOTO ZAUSTAVLJA 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 PWM1ON CALL PWM2ON BSF PORTD, 0 BCF PORTD, 1 BSF PORTB, 1 BCF PORTB, 2 POZIV Sdelay MOVLW 0xff MOVWF SPEED11 MOVLW 0X4C MOVWF SPEED12 MOVLW 0XEF MOVWF SPEED21 MOVLW 0XB3 MOVWF SPEED22 POZIV PWM1ON POZIV PWM2ON BSF PORTD, 0 BCF PORTD, 1 BCF PORTB, 2 REP14 POZIV STALL1 BTFSC MSTOP, 0 GOTO STOPS BOTS BOTS ****************************************** BFAST BCF STATUS, RP0 BCF STATUS, RP1 MOVLW 0X00 MOVWF MSTOP BCF LDET, 0; POZIVNI BUTTLEV; PWM2ON BSF PORTD, 0 BSF PORTD, 1 BCF PORTB, 1 BCF PORTB, 2 POZIVA SDELAY MOVLW 0XEF MOVWF SPEED11 MOVLW 0X66 MOVWF SPEED12 MOVLW 0XEF MOVWF SPEED21 MOVLW 0X66 MOVWFWW SPE22 PORTD, 0 BSF PORTD, 1 BCF PORTB, 1 BCF PORTB, 2 REP15 POZIV STALL1 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 STOPS BSF PORTD, 2 BCF PORTD, 3 REP16 BTFSC PORTO, 5 GOTO 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 GOTO GOTO CLROE; ***************************************** HUP BCF STATUS, RP0 BCF STATUS, RP1 MOVLW 0X00 MOVWF MSTOP BCF LDET, 0; POZIVNI TASTER; BTFSC MSTOP, 1; GOTO STOPS POZIV DARKLIGHT BTFSC LDET, 0; BSF PORTB, 7 BTFSC PORTC, 4 GOTO STOPS BCF 18 BTFSC PORTC, 4 GOTO ZAUSTAVLJANJA 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 POZIVA PWM1OFF POZIV PWM2OFF BCF PORTD, 0 BCF PORTD, 1 BCF PORTD, 2 BCF PORTD, 3 BSF MSTOP, 6 REPLF; OPCIJA OPCIJE_BANKE, 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, GIE BANK, 0 BCF PCON, 1 NOP BSF PCON, 0 BSF PCON, 1 BCF STATUS, RP0 BCF STATUS, RP1 MOVLW 0X00 MOVWF MSTOP POZIV SDELAY CALL LFC1 NOP POZIV 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 BUTTLEVLO; 0X66 MOVWF SPEED12 MOVLW 0XFF MOVWF SPEED21 MOVLW 0X99 MOVWF SPEED22 POZIV PWM1ON POZIV PWM2ON BSF PORTD, 0 BCF PORTD, 1 BSF PORTB, 1 BCF PORTB, 2 LR1GREP; CALL STALL1; OPS BANKSEL PIR1 BTFSC PIR1, RCIF IDI NA RXDATA POZIV LFC1 NOP POZIV LFC2 NOP MOVF LR2, 0 SUBWF LR1, 0 BTFSC STATUS, Z GOTO REPLF POZIV LFC1 NOP CALL LFC2 NOP MOVF LRTO, SUB REPLF LR2G BCF STATUS, RP0 BCF STATUS, RP1 MOVLW 0X00 MOVWF MSTOP; POZIVNI BUTTLE; BTFSC MSTOP, 1; PORTD, 1 BCF PORTB, 1 BSF PORTB, 2 LR2GREP; POZIV STALL1; BTFSC MSTOP, 0; GOTO STANOVI BANKSEL PIR1 BTFSC PIR1, RCIF GOTO RXDATA POZIV LFC1 NOP CALL LFC2 NOP MOVF LRT, SUB 0, SUB REPLF CALL LFC1 NOP CALL LFC2 NOP MOVF LR2, 0 SUBWF LR1, 0 BTFSC STATUS, C IDI 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 POZIV PWM1ON POZIV 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 MSTOPO, 3; GALL NOP POZIV LFC2 NOP MOVF LR2, 0 SUBWF LR1, 0 BTFSC STATUS, Z GOTO FROREP GOTO REPLF GOTO CLROE; ************************* ********** 1 POZIV 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 POZIV PWM1OFF POZIV PWM2OFF BCF 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 POZIVNI KONVERT MOVF ADRESH, 0 SUBLW 0X70 BTFSS STATUS, C BSF MSTOP2, BCF STOP, 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 POZIVNI KONVERT MOVF ADRESH, 0 SUBTFS 0 BTS STATUS, RP0 BCF STATUS, RP1 STATUS RETURNBUTTLEVEL BCF STATUS, RP0 BCF STATUS, RP1 MOVLW 0X00 MOVWF MSTOP BANKSEL ADCON0 BCF ADCON0, 3 BCF ADCON0, 4 BSF ADCON0, 5 BCF STATUS, RP0 BCF, RP0 BCF, RP0 BCF BTFSS STATUS, C GOTO BL1 GOTO BL2 BL1 BSF MSTOP, 1 BSF PORTB, 6 BL2 POVRATAK TAMNO SVJETLO BCF STATUS, RP0 BCF STATUS, RP1 BTFSC LDET, 0 GOTO RETFDL BANKSEL ADCON0 BCF ADCON0, 3 BSF ADCON0, 4 BCF ADCON0, 5 BCF STATUS, RP1 POZIV KONVERT MOVF ADRESH, 0 SUBLW 0XEE BTFSS STATUS, C BSF PORTBETON 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 0XFFF MFWW RPV, RPC BCV 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, BSF2, TCP2 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 0XF0CCFFC RPC, RP0 BCF STCUS 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 BANKSEL PR2 MOVLW 0X00 MOVWF PR2 BCCFFAT, RPC 5 BCF STATUS, RP0 BCF STATUS, RP1 POZIV KONVERT MOVF ADRESH, W ANDLW 0XF0 MOVWF LR1 BCF STATUS, RP0 BCF STATUS, RP1 POVRAT LFC2 BANKSEL ADCON0 BCF ADCON0, 3 BSF ADCON0, 4 BSF BCF, 4 BSF RP1 POZIVNI KONVERT MOVF ADRESH, 0 ANDLW 0XF0 MOVWF LR2 BCF STATUS, RP0 BCF STATUS, RP1 POVRATAK LDIN BANKSEL ADCON0 BCF ADCON0, 3 BSF ADCON0, 4 BCF ADCON0, 5 BCF STATUS, RP0 BCF STB 0X4C BTFSC STATUS, C IDITE NA COMP4 BSF MSTOP, 3 COMP4 BCF STATUS, RP0 BCF STATUS, RP1 POVRATAK 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 WT2 S2 WT, S GOTO W2 XL3 POVRATAK NEMOJ NAPRAVITI
Druga nagrada na takmičenju robota Instructables i RoboGames
Preporučuje se:
Napravite vlastiti adapter za rock bend Ekit (bez naslijeđenog adaptera), bez razaranja!: 10 koraka
Učinite svoj vlastiti Rock Band Ekit adapter (bez naslijeđenog adaptera), bez razaranja !: Nakon što sam čuo popularnog voditelja podcasta da spominje svoju zabrinutost zbog umiranja njegovog ožičenog USB nasljednog adaptera, otišao sam tražiti DIY rješenje za povezivanje boljeg/prilagođenog eKita na RB . Hvala gospodinu DONINATORU na Youtube -u koji je snimio video sa detaljima o svom sličnom
Ručne Arduino škare za kamen Rock papir pomoću 20x4 LCD ekrana sa I2C: 7 koraka
Ručne Arduino papirne škare za škare za papir pomoću 20x4 LCD ekrana sa I2C: Pozdrav svima ili bih možda trebao reći "Hello World!" Ovo je igra Ručne Arduino škare za kamen za papir koja koristi I2C 20x4 LCD ekran. Ja
Pretvorite bubnjeve rock benda X-box u midi samostalne elektronske bubnjeve .: 4 koraka (sa slikama)
Pretvorite bubnjeve rock benda X-box u midi samostalne elektronske bubnjeve. Imao sam sreću što sam nabavio rabljeni set bubnjeva x-box, pomalo je grubog oblika i nema vesla, ali ništa što se ne može popraviti. pretvorite u samostalni električni set bubnjeva. Očitavanje analogne vrijednosti sa piezo senzora i pretvaranje u MIDI komandu
Robotski daljinski upravljač Rock Crawler Arduino: 4 koraka
Robotski daljinski upravljač Rock Crawler Arduino: Ovo izgleda i vrlo je barebone. Preporučio bih svima koji žele raditi na ovom projektu da razmotre neki način pokrivanja elektronike kako bi se zaštitili od vode i prljavštine
Rock Buggy Body za RedCat Gen7: 9 koraka (sa slikama)
Rock Buggy Body za RedCat Gen7: Inspiration3D Štamparski pribor, pa čak i cijela tijela vrlo je popularan među RC zajednicom, posebno u žanru RC Crawlers. Ja i drugi smo objavili sve vrste besplatnih projekata, ali ono što se ne čuje je da proizvođači objave