Cov txheej txheem:

Warhammer Sorcerer ntawm Disc Nrog Magnetically-Coupled Motor thiab LEDs: 4 Cov Kauj Ruam
Warhammer Sorcerer ntawm Disc Nrog Magnetically-Coupled Motor thiab LEDs: 4 Cov Kauj Ruam

Video: Warhammer Sorcerer ntawm Disc Nrog Magnetically-Coupled Motor thiab LEDs: 4 Cov Kauj Ruam

Video: Warhammer Sorcerer ntawm Disc Nrog Magnetically-Coupled Motor thiab LEDs: 4 Cov Kauj Ruam
Video: Dawn of War 2 Chaos Rising: Chaos Sorcerer Quotes 2024, Kaum ib hlis
Anonim
Warhammer Sorcerer ntawm Disc Nrog Magnetically-Coupled Motor thiab LEDs
Warhammer Sorcerer ntawm Disc Nrog Magnetically-Coupled Motor thiab LEDs

Xav ntxiv qee PIZZAZZ rau koj cov haujlwm kos duab? Cov motors thiab LEDs yog txoj hauv kev mus!

Koj puas yog Warhammer kev nyiam ua si? Qhov no yog rau koj! Nov yog kuv Tzeentch Sorcerer Tswv ntawm Disc, kho dua nrog 3 LED's, lub cev muaj zog, lub micro (PIC) thiab roj teeb me me. Cov lus qhia no qhia txog kev ua tiav thiab teeb meem.

Kauj ruam 1: Circuit Court

Circuit Court
Circuit Court

Ua ntej, koj yuav xav tsis thoob tias qhov no yog dab tsi. Nov yog kuv qhov kev cai ua me me rau saum lub rooj ntaus rog hu ua Warhammer. Tus txiv leej tub nyob rau sab saum toj yog tus qauv tsis tu ncua los ntawm tus tsim cov game (Gamesworkshop), tab sis daim disk thiab lub hauv paus yog txhua yam ntawm kuv. Kev tsim rau nws yog lub ntsiab lus ntawm lwm qhov kev qhia, yog li kuv yuav tsis nkag mus rau qhov ntawd. CircuitQhov tswv yim yooj yim ntawm no yog coj me me, 8 tus pin micro los tswj 3 LEDs thiab lub cev muaj zog, nrog rau cov khoom me me li sai tau. Kev siv "pab txhais tes", zoo li ib txwm muaj, yog lub tswv yim zoo. Cov khoom no muaj ob daim kab xev los tuav yam koj tab tom ua haujlwm. No xav tau schematic, raws li kev hais tawm yog yooj yim heev; 8 tus pin micro (Microchip PIC) nrog 3 tus pin tso tawm ncaj qha mus rau LEDs, thiab 2 tus pin tso tawm mus rau 1 lub cev muaj zog.. Qhov LED tau siv yog Xiav, Dawb thiab Liab sab saum toj hom. Qhov lub cev siv tau ripped los ntawm qhov tawg sab hauv tsev micro helecopter. Lub roj teeb (me me Lipo) kuj tseem raug ripped los ntawm heli, tab sis kuv twb npaj yuav siv lwm qhov ntxiv rau ntau dua fais fab. Hloov tau ntxiv rau On/Off.

Kauj ruam 2: Code

Code
Code

Cov cai rau PIC tau tsim los txhawm rau ua kom lub roj teeb tau zoo thiab siv ntau yam xwm txheej "xwm txheej." Txhawm rau kom lub roj teeb nyob ntev li ntev tau, lub Circuit Court yuav tsum siv lub zog tsawg tshaj plaws uas kuv tuaj yeem suav tau, thaum ua kom lub tswv yim muaj sia nyob. Yog li, kuv txiav txim siab txo qis kev ua haujlwm thawj zaug rau qhov nruab nrab ntawm 1 LED nyem lossis lub zog txav txhua txhua 6 vib nas this. Txoj cai muaj 12 qhov "ua haujlwm" tsis sib xws, suav txij li 1 LED qhib, lub cav tig rau lub sijhawm sib txawv lossis cov lus qhia, mus rau lub xeev tos tsis raug. Cov xwm txheej sib txawv los ntawm 3seconds sib nrug mus rau ntau dua 40 vib nas this sib nrug, raws li qhov xwm txheej tshwm sim random. CODE; ============================= ====================================================================== Disc Tswj; ------------; Vcc-> | 18 | <-Vss; MGPIO5 | 27 | GPIO0 -LED1; MGPIO4 | 36 | GPIO1 -LED2; GPIO3-> | 4 5 | GPIO2 -LED3; -----------;; ======================================== ============================================; Kho dua keeb kwm & Sau ntawv:; V1.0 Thawj Header, Code 5/19/09;; (C) 5/2009; Cov cai no yuav raug siv rau kev kawm tus kheej/thov/hloov kho..; ------------------------------------------------------- -------------------------------#suav nrog P12C672. INC; ============= ====================================================================== ================; Txhais; ------------------------------------------------ -------------------------------; ================== ====================================================================== ===========; Cov ntaub ntawv; ------------------------------------------------ -------------------------------; Lub sijhawm khaws cov lej sib npaug 1 sib npaug 20 suav 2 sib npaug 21 ncua sib npaug 22Randlo equ 23Randhi equ 24Wtemp equ 25Temp2 equ 26rand equ 27count3 equ 28; ========================== ====================================================================== ===; Pib dua Vectors;; CHECK CONFIG. BITS ua ntej hlawv !!!; INTOSC; MCLR: ENABLED; PWRUP: ENABLED; TXHUA lwm tus: TSEV !!;; ----------------------------------------------- ------------------------------------- RESET_ADDR EQU 0x00 org RESET_ADDR tau pib; ===== ====================================================================== ========================; Pib Ntawm No!; ---------------------------------------------- --------------------------------- pib; Config I/O ports bcf STATUS, RP1 bsf STATUS, RP0 movlw h'08 '; RA Outputs, PGIO3 ib txwm nkag mus tris GPIO movlw h'07'; Teeb GPIO rau Digital hom movwf ADCON1; Teem caij timer movlw h'CF '; Tmr0 Internal qhov chaw, prescale TMR0 1: 256 movwf OPTION_REG movlw h'00 'movwf INTCON; Lov tes taw TMR0 cuam tshuam, bcf STATUS, RP0; Pib sau npe sau npe clrf GPIO clrf count1 clrf count2 movlw 045h movwf Randlo movlw 030h movwf Randhi; tos 1 sec. hu debounce; 0.2 sec hu debounce hu debounce hu debounce hu debounce; ======================================= ========================================; Lub ntsiab; ------------------------------------------------ ------------------------------- lub ntsiab hu twosec; 2 secs min ntawm txhua qhov kev ua rrf Randhi, W xorwf Randlo, W movwf Wtemp swapf Wtemp rlf Randhi, W xorwf Randhi, W; LSB = xorwf (Q12, Q3) xorwf Wtemp rlf Wtemp rlf Randlo rlf Randhi movfw Wtemp; strip random 16 down to 7 andlw 0x0F movwf rand; kev xaiv ua ntu zus xorlw 0x00; 0? btfsc STATUS, Z tau txais flash1; Yog lawm Hu rau 0th movfw rand xorlw 0x01; 1? btfsc STATUS, Z tau txais flash2; Yog lawm Hu 1st movfw rand xorlw 0x02; 2? btfsc STATUS, Z tau txais flash3; Yog lawm Hu rau 2nd movfw rand xorlw 0x03; 3? btfsc STATUS, Z tau txais flashall; Yog lawm Hu rau 3rd movfw rand xorlw 0x04; 4? btfsc STATUS, Z tau txav mus los; Yog lawm Hu rau 4th movfw rand xorlw 0x05; 5? btfsc STATUS, Z tau txav mus los; Yog lawm Hu rau 5th movfw rand xorlw 0x06; 6? btfsc STATUS, Z tau txais kev txav mus; Yog lawm Hu 6 movfw rand xorlw 0x07; 7? btfsc STATUS, Z tau txais kev hloov pauv; Yog lawm Hu rau 7th movfw rand xorlw 0x08; 8? btfsc STATUS, Z tau txais kev txav mus los; Yog lawm Hu rau 8th movfw rand xorlw 0x09; 9? btfsc STATUS, Z tau txais Tos1; Yog lawm Hu rau 9th movfw rand xorlw 0x0A; A? btfsc STATUS, Z goto Tos2; Yog lawm Hu rau Ath movfw rand xorlw 0x0B; B? btfsc STATUS, Z tau txais Tos3; Yog lawm Hu rau Bth tsis muaj dab tsi; 1/4 lub sijhawm, tsis ua dab tsi rau 10 secs.flash1 bsf GPIO, 0 hu debounce bcf GPIO, 0 goto mainflash2 bsf GPIO, 1 hu debounce bcf GPIO, 1 goto mainflash3 bsf GPIO, 2 hu debounce bcf GPIO, 2 goto mainflashall bsf GPIO, 0 bsf GPIO, 1 bsf GPIO, 2 hu debounce hu debounce bcf GPIO, 0 bcf GPIO, 1 bcf GPIO, 2 goto mainmovels bsf GPIO, 4 bcf GPIO, 5 hu debounce bcf GPIO, 4 goto mainmovell bsf GPIO, 4 bcf GPIO, 5 hu debounce hu debounce bcf GPIO, 4 goto mainmovers bcf GPIO, 4 bsf GPIO, 5 hu debounce bcf GPIO, 5 goto mainmoverl bcf GPIO, 4 bsf GPIO, 5 hu debounce hu debounce bcf GPIO, 5 goto mainmoveburst bcf GPIO, 4 bsf GPIO, 5 hu debounce; txav mus sab xis 3 zaug, tawg nthe luv. bcf GPIO, 5 hu debounce hu debounce bsf GPIO, 5 hu debounce hu debounce bcf GPIO, 5 hu debounce hu debounce bsf GPIO, 5 hu debounce bcf GPIO, 5 hu debounce hu debounce hu hu debounce bsf GPIO, 4; txav sab laug 3 zaug, tawg ntho luv. bcf GPIO, 5 hu debounce hu debounce bcf GPIO, 4 hu debounce hu bounce GPs GPIO, 4 hu debounce hu debounce bcf GPIO, 4 hu debounce hu debounce bsf GPIO, 4 hu debounce hu debounce bcf GPIO, 4 hu debounce hu debounce goto mainWait1; Tos 1 vib nas this movlw.255; Ncua rau 2/10 thib ob debounce. movwf count2 hu rau pon_wait movlw.255; Ncua rau 2/10 thib ob debounce. movwf count2 hu rau pon_wait movlw.255; Ncua rau 2/10 thib ob debounce. movwf count2 hu rau pon_wait movlw.255; Ncua rau 2/10 thib ob debounce. movwf count2 hu rau pon_wait movlw.255; Ncua rau 2/10 thib ob debounce. movwf suav 2 hu pon_wait goto mainWait2; Tos 0.6 vib nas this movlw.255; Ncua rau 2/10 thib ob debounce. movwf count2 hu rau pon_wait movlw.255; Ncua rau 2/10 thib ob debounce. movwf count2 hu rau pon_wait movlw.255; Ncua rau 2/10 thib ob debounce. movwf count2 hu rau pon_wait goto mainWait3; Tos 4 vib nas this hu twosec hu twosec goto mainnothing movlw.50; Ncua rau 10 vib nas this Tag movwf count3nothing_loop movlw.255; Ncua rau 2/10 thib ob debounce. movwf count2 hu rau pon_wait decfsz count3, F tsis muaj dab tsi_loop goto lub ntsiab; ======================================= ============================================; 2 thib tos; ---------------------------------------------- --------------------------------- twosec movlw.10; Ncua rau 2 vib nas this Tag movwf count3twosec_loop movlw.255; Ncua rau 2/10 thib ob debounce. movwf count2 hu rau pon_wait decfsz count3, F goto twosec_loopreturn; ======================================================= ========================================; Tshaj tawm lub teeb liab; 4 mus thauj khoom thiab hu, 2 mus kom rov qab los; 4Mhz Tc:: suav2 = 255-> 0.2 sec; -------------------------------------- ----------------------------------------- debounce movlw.127; Ncua rau 1/10 thib ob debounce. movwf suav2 hu pon_wait rov; -------------------------------------------- ---------------------------------------; suav 1 = 255d:: 775 mus rau 0, + 3 mus kom rov los.; --------------------------------- ---------------------------------------------- pon_waitbig_loopS movlw.255 movwf count1short_loopS decfsz count1, F goto short_loopS decfsz count2, F goto big_loopSreturnend

Kauj Ruam 3: Qhov Chaw

Qhov
Qhov

Daim duab no qhia tau hais tias kuv yuav tsum tau txais cov khoom me me kom haum rau tus txiv neej no li cas. 8-pin Microchip (PIC) 3 SMT LED's (Xiav, Liab, Dawb) 1 Tsav los ntawm sab hauv micro heli.1 LIPO roj teeb los ntawm tib lub heli. 1 lub zog hloov 1 2.5mm ntoo dowel (2 ntev) 2 1mm lub ntiaj teb tsis tshua muaj hlau nplaum

Kauj ruam 4: Tsim

Tsim
Tsim

Thawj qhov chaw nruab nrab ntawm qhov loj rau txhua yam tau pom. Qhov no yuav yog thaj chaw tsav tsheb. Lub cav tau teeb tsa siv lub goop hu ua Greenstuff (siv hauv ntiaj teb me me). Cov 3 LED tau ua ntej lawm. Qhov micro tau zoo nyob hauv qhov chaw ntawm txoj kev, tsis dhau ze rau ntawm ntug. Lub hwj chim hloov thiab roj teeb tau teeb tsa kom txo qhov (me me) qhov hnyav ntawm micro, kom ua kom sib npaug. Cov xov hlau tau muab tso rau ntawm Qhov zoo tshaj plaws yog qhov txuas ntxiv mus. Qhov zoo ntawm qhov kawg ntawm lub rotor iav ntawm lub tshuab (qhov no yuav tig rov tom qab) lub ntiaj teb tsis tshua muaj hlau nplaum tau teeb tsa. Qhov luv (~ 2 ) qhov ntev ntawm 2.5 txoj kab uas hla ntoo ntoo tau laum tawm (siv tes thiab me ntsis) rau 5mm tob 1mm txoj kab uas hla. Ua ke nrog lub rotor ntawm lub tshuab. Thaum lub cav tig, los ntawm nws qhov nruab nrab ntawm qhov sib npaug, nws tig tag nrho sab saum toj ntawm daim duab. Cov quav quav liab tau txiav los npog lub cav thiab ntoo dowel. LIPO roj teeb tam sim no nyeem 3.4V yam tsis tau them nyiaj ntxiv. siv 12V roj teeb nyob deb nrog 5V tus tswj hwm rau lub zog ntau dua!

Pom zoo: