Satura rādītājs:
- 1. solis: projektējiet projektu
- 2. darbība: izvēlieties ierīces un komponentus
- 3. solis: mikrokontrolleris
- 4. solis: uzrakstiet datora programmu
- 5. solis: izveidojiet ķermeni
- 6. darbība: izveidojiet bezvadu ķēdi
- 7. solis: integrējiet
- 8. solis: mikrokontrollera programmas kods
Video: Roks: 8 soļi
2024 Autors: John Day | [email protected]. Pēdējoreiz modificēts: 2024-01-30 10:58
Šo robotu kontrolē vizuāla pamatprogramma (caur seriālo portu), un tas var pārvietoties trīs dažādos ātrumos, izmantojot impulsa platuma modulētu (PWM) signālu, ko ģenerē PIC mikrokontrolleris (16F877). Robotu var darbināt divos režīmos - "parastās vadības" un "gaismas izsekotāja" režīmos. Parastā vadības režīmā robots var pārvadāt priekšmetus, kuru izmērs ir no 3 līdz 18 cm no vietas uz otru 150 m attālumā. tā kā gaismas izsekotāja režīmā tas seko gaismai tumšā telpā. Tika izmantoti daudzi sensori, piemēram, gaismas sensori; slīpuma sensors, strāvas nobīdes noteikšana, akumulatora uzlādes līmeņa noteikšana, kā arī daži gala slēdži un pieskārienu sensori, ko izmanto rokā. Tas var saglabāt nemainīgu ātrumu, kad tas iet uz kalna (noliekts), un automātiski ieslēdz gaismu, kad kļūst tumšs tumšs. Arī, lai saglabātu IC drošību, tas atvieno strāvu, kad tas ir iestrēdzis, un roka apstājas, turot kaut ko. 4 līdzstrāvas motori tika izmantoti, kontrolējot ar PIC mikrokontrolleri 16F877 un 3 motora draivera ķēdes. Tas aizņēma apmēram 4 mēnešus un maksāja aptuveni 600 USD
1. solis: projektējiet projektu
sākotnējā posmā tika izstrādāts projekta dizains. galvenokārt, nosakot blokshēmu; skatiet attēlu.
Šajā posmā ir nepieciešama detalizētāka shēmas shēma, tomēr, lai to atvieglotu, tika identificēti galvenie moduļi: 1. mikrokontrolleris 2. sensori 3. motori 4. bezvadu ķēde 5. datora programma. Tika izveidots arī 3D dizains, skatiet attēlu.
2. darbība: izvēlieties ierīces un komponentus
Šajā posmā dizainerim jāizvēlas robota uzbūvei nepieciešamās ierīces un sastāvdaļas.
Tas ietver: bezvadu ķēdi (MAX232, LM331, FM raidītāja un uztvērēja moduļus), motorus (4 līdzstrāvas motori), motoru draiveru ķēdi (H-tilts), mikrokontrolleru PIC (16F877), akumulatoru, sprieguma regulatorus (MC7805), mikroslēdžus, Fotorezistori, slīpuma sensors … utt. Ir svarīgi saprast šo ierīču aprēķināmību un to, kā tās darbojas kopā.
3. solis: mikrokontrolleris
Šis solis ir vissvarīgākais. sākumā jāidentificē kodi, kas tiks saņemti un pārsūtīti no PIC.
Sāciet savienot komponentus ar atbilstošajām PIC tapām un ieprogrammējiet mikrokontrolleru. Tam var būt nepieciešams izveidot nelielas shēmas, izmantojot regulatorus, rezistorus, sensorus utt.
4. solis: uzrakstiet datora programmu
Programma tika uzrakstīta uz vizuālās bāzes.
Sakari tika izveidoti, izmantojot RS-232. MSComm izmantošana datu nosūtīšanai uz mikrokontrolleri, konfigurējot iestatījumus (porta numurs, bodu pārraides ātrums, datu bitu paritātes numurs, stopbiti). Es izmantoju 8 bitu datus ar vienas pieturas bitu un paritāti ar bodu ātrumu 9600 bps.
5. solis: izveidojiet ķermeni
Labs korpusa dizains ir svarīgs. Izvēloties arī riteņu izvietojumu, skatiet attēlu.
robots tika uzbūvēts pēc tam, kad bija pārliecinājies, ka programmas darbojas labi. Šo darbību var veikt arī pirms programmēšanas.
6. darbība: izveidojiet bezvadu ķēdi
Bezvadu ķēdes veidošana var būt neatkarīga. Sākotnējā posmā es izmantoju vadu, lai savienotu datoru ar robotu, un pēc robota pabeigšanas bezvadu ķēde tika integrēta.
7. solis: integrējiet
Šis ir brīdis, kad mēs integrējām savus komponentus un pārbaudījām robotu.
8. solis: mikrokontrollera programmas kods
; *************** FINAL ******************************* saraksts p = 16f877 ietver radix decidlocs "V" << 8 | "1"; Versijas Nr. Konfigurācija _CP_OFF & _PWRTE_OFF & _WDT_OFF & _XT_OSC; ********** galvenais mainīgais ************************** cblock 0x20; sākums bankas 0 ram zona INPUT_VAR L1 L2 X SPEED11 SPEED12 SPEED21 SPEED22 MSTOP LDET LR1 LR2 endc; ********** galvenās programmas sākums *************** sākums 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 MOVLW 0W TRISD MOVLW 0X07; PORT E IS I MOVWF TRISE BANKSEL OPTION_REG BCF OPTION_REG, T0CS BCF STATUS, RP1 BCF STATUS, RP0; ************************* ******************; ****************************** ************ Gaidiet 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 RSS RTS, 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 PIF, PF, PF, PF, PF, PF, PF, PF, PF, PF, PF, PF, PF, PF, PF, PF, PF, PF, PF, PF, PF, PF, PF, PF, PB, PF, PB, PF, PF, PF, PF, PF, PF, PF, PF, PF, PFB CALL PWM1OFF ZVANIET PWM2OFF CALL DARKLIGHT BTFSC LDET, 0 BSF PORTB, 7RXDATA; BANKSEL RCSTA; BTFSC RCSTA, OERR; GOTO STOPS CALL PWM1OFF CALL PWM2OFF CALL BROFF CALL 0; ******************************************** *************************************** MOVWF INPUT_VAR MOVLW 0X00 MOVWF RCREG BCF STATUS, RP0 BCF STATUSS, 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; GAISTS ATLĪDZĪBA 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 LOW SUBLW 0 X6C BTFSC STATUS, Z GOTO LSLOW MOVF INPUT_VAR 0 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 GFWO FVO FVO FVO FVO FVO FVO FVO FVO FVO FVO FVO FVO FVO FVO FVO FVO FVO FVO FVO FVO FVO FVO FVO FVO FVO ZVOTT Z Goto FFAST MOVF INPUT_VAR, 0; pa labi FAST SUBLW 0X57 BTFSC STATUS, Z Goto RFAST MOVF INPUT_VAR, 0; pārvietotos pa kreisi FAST SUBLW 0X56 BTFSC STATUS, Z Goto LFAST MOVF INPUT_VAR, 0; pārvietotos atpakaļ FAST SUBLW 0X58 BTFSC STATUS, Z Goto BFAST MOVF INPUT_VAR, 0; ROKU AIZVĒRŠANA 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 SUV; ROKAS 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; CALL BUTTLEVEL; BTFST BSTSTALLSSTOUT 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 PWD 2 PFP 1 PFMD 1 BF, RCIF GOTO RXDATA GOTO REP3 GOTO CLROE; **************************************** ** LSLOW BCF STATUS, RP0 BCF STATUS, RP1; CALL BUTTLEVEL; BTFSC MSTOP 1 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; CALL BUTTLEVEL; BTFSC MSTOP, 1; GOTO STOPS MOVLW 0X00 MOVWF MSTOP BCF LDET, 0 CALL DARKLIGHT BTFSC LDET, 0; BSF PORTW, 7 MSL 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 PORTBORT, 1 BRS PORT. **************************** BSLOW 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 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 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 STOPD STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP 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 PORTDFORT, 0 BF 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 ZVANA PWM1ON ZVANS PWM2ON BCF PORTD, 0 BSF PORTD, 1 BSP 1 PFP PORT 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 CALL DARKLIGHT BTFSC LDET, 0; BSF PORTB, 7 MOVLW MWWWWWWWW 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; ZVANIET STALL1; BTFSC SKTSTO REP9 GOTO CLROE; ***************************************** BMED BCF statuss, 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 CALL PWM1ON CALL PWM2ON BSF PORTD, 0 BSF PORTD, 1 BCF PORTB, 1 BCF PORTB, 2 REPT REPT REPT BALL 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 0XWW MWLW MX 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 STOPS BANKSEL PIR1 BTFSC PIR1, RCIF GOTO RXDATA POP PFT, AST MOVLW 0XCF MOVWF SPEED11 MOVLW 0XFF MOVWF SPEED12 MOVLW 0XCF MOVWF SPEED21 MOVLW 0XFF MOVWF SPEED22 ZVANA PWM1ON ZVANS PWM2ON BCF PORTD, 0 BCF PORTD, BIR 1 BS 1 BS 1 BS, 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 MOVLW 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 PORTBOLS, RT 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 PWM1ON CALL PWM2ON BSF PORTD, 0 BCF PORTD, 1 BSF PORTB, 1 BCF PORTB, 2 CALL 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 STOPS BOTS BOTS ***************************************** 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 Speed 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 MOVWWW 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; ************* ******************************************************************************************************************************************************************************************************************************************************************** Taktibaktiskaktibibdzekibtivatáros V maksneciativates zibspuldzes statusa statusu, kas RP0 BCF STATUS. BTFSC MSTOP 1 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 BTFPOT PIRT GOTO 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 0 BCF 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_REGTION, 3; BSF OPTION_REGTION, 3;, 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, GONI BANKI, 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 STOUS 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; ZVANA BUTTLEVEL; BTFSC MSTW 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 0 STALLT; 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 SUBWOPS 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 SPEEDF MFWW MOVWW MOVWW MOVW 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 SUBW 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 BUTTLEFLOVT; 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 GALT STOP, 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 SPWD SPLED SPLING SPEED SPEED SPEED SPEED SPEED SPEED SPEED SPEED SPEED SP2 1 ZVANA 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 ZVANS 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 CALL CONVERT MOVF ADRESH, 0 SUBLW 0X70 BTFSS STATUS, C BSF MSTOP, 0 RPF BCF STATUS, 0 BCF BCF STATUS STATUSS, RP0 BCF STATUSS, 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 SUBLT 0XSSBSS STATUSS, RP0 BCF STATUSS, 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, RP0 RPM RPT 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 CALL CONVERT MOVF ADRESH, 0 SUBLW 0XEE BTFSS STATUS, C BSF PORTBONS BDFRD RDS 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 STFRFRFF RPF RPV SPF SPF 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 T2CONCONCONCONCONCONCONCONCONCONCONCONCONCONCONCONCONCONCONCONCONCONCONT 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 MOVF SPRFF, BC1 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 BC1 ADFFC, BFKS ADFC, BFSK ADFT, BFFFC BROCTS, BFSK ADFT 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 BCS ADC 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 STATUS, RP0 RPF FLAT STRV 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 GOTF GOTFLOX COLT XL3 RETURN NOP NOPEND
Otrā balva instrukciju un RoboGames robotu konkursā
Ieteicams:
Arduino brīdinājuma sistēma par automašīnas novietošanu atpakaļgaitā Soli pa solim: 4 soļi
Arduino brīdinājuma sistēma par automašīnas novietošanu atpakaļgaitā Soli pa solim: Šajā projektā es izveidošu vienkāršu Arduino automašīnas atpakaļgaitas stāvvietas sensora shēmu, izmantojot Arduino UNO un ultraskaņas sensoru HC-SR04. Šo uz Arduino bāzēto automašīnas reverso brīdinājuma sistēmu var izmantot autonomai navigācijai, robotu diapazonam un citiem diapazoniem
Soli pa solim datora veidošana: 9 soļi
Soli pa solim datora veidošana: Piegādes: Aparatūra: mātesplateCPU & CPU dzesētājs PSU (barošanas bloks) Krātuve (HDD/SSD) RAMGPU (nav nepieciešams) Korpuss Instrumenti: skrūvgriezis ESD rokassprādze/matermālā pasta ar aplikatoru
Trīs skaļruņu shēmas -- Soli pa solim apmācība: 3 soļi
Trīs skaļruņu shēmas || Soli pa solim apmācība: Skaļruņu ķēde pastiprina no vides saņemtos audio signālus uz MIC un nosūta to skaļrunim, no kura tiek radīts pastiprināts audio. Šeit es parādīšu trīs dažādus veidus, kā izveidot šo skaļruņu shēmu, izmantojot:
Arduino Halloween Edition - zombiju uznirstošais ekrāns (soļi ar attēliem): 6 soļi
Arduino Helovīna izdevums - zombiju uznirstošais ekrāns (soļi ar attēliem): Vai vēlaties Helovīnā nobiedēt savus draugus un radīt kliedzošu troksni? Vai arī vienkārši gribi uztaisīt labu palaidnību? Šis zombiju uznirstošais ekrāns to var izdarīt! Šajā pamācībā es iemācīšu jums, kā viegli izveidot izlecošus zombijus, izmantojot Arduino. HC-SR0
Akustiskā levitācija ar Arduino Uno soli pa solim (8 soļi): 8 soļi
Akustiskā levitācija ar Arduino Uno soli pa solim (8 soļi): ultraskaņas skaņas pārveidotāji L298N līdzstrāvas adaptera strāvas padeve ar vīriešu līdzstrāvas tapu Arduino UNOBreadboard un analogie porti koda konvertēšanai (C ++)