Cov txheej txheem:

Digilog_Bike POV Zaub: 14 Kauj Ruam
Digilog_Bike POV Zaub: 14 Kauj Ruam

Video: Digilog_Bike POV Zaub: 14 Kauj Ruam

Video: Digilog_Bike POV Zaub: 14 Kauj Ruam
Video: Plab Plab Ntswg..(Pluav Pluav Ntswg) Maiv Twm New Song 2023-2024 2024, Hlis ntuj nqeg
Anonim
Image
Image

Digilog

Digital + Analog

Digital raws li analog

POV

Zam Kev Pom Kev

Kuj tseem paub tias yog cov duab tom qab, yog tshee ntawm qhov nrawm, tom qab duab tseem nyob.

Tib neeg xav tias lawv saib yeeb yaj kiab thaum lawv saib TV. Tab sis qhov tseeb, nws tab tom saib ob peb daim duab sib law liag. Qhov no yuam kev rau daim duab vim tias muaj cov nyhuv tom qab cov duab nyob hauv peb cov retinas thaum saib cov duab txuas ntxiv. Hom kev xav tsis zoo no hu ua POV.

Kauj Ruam 1: Lub Tswv Yim Tswv Yim

Lub Tswv Yim Tswv Yim
Lub Tswv Yim Tswv Yim

POV tau ua tiav los ntawm kev txuas cov hlua LED rau lub log ntawm lub tsheb kauj vab.

Kauj Ruam 2: Cov Khoom Qhia

Cov Khoom Qhia
Cov Khoom Qhia
Cov Khoom Qhia
Cov Khoom Qhia

Xam & I/O

1. Arduino Mega 2560 [arduino] x3

2. Hall sensor module V2 [YwRobot] x3

3. WS2812-5050 Saj zawg zog Neopixel [Adafruit] x3

4. Sib nqus (txoj kab uas hla ntawm 15mm, tuab ntawm 50mm) x3

5. Arduino Mega Case x3

Fais Fab Kab

5. 5000mAh/3.7V Lithium Battery [TheHan] x3

6. AVR 5V tus tswj hwm & them nyiaj & PCM module: JBATT-U5-LC [Jcnet] x3

7. 4Jumper wire kit 65PCS/SET [OR0012] x3

Kauj Ruam 3: Cov Cuab Yeej

Cov cuab yeej
Cov cuab yeej

Tsis muaj ntau yam cuab yeej xav tau tab sis koj yuav xav tau:

1. Tshuab Soldering

2. Ib rab hlau

3. Rab yaj phom

4. Nipper

Kauj Ruam 4: Ua Ncej

Image
Image
Ua Ncej
Ua Ncej

Txiav tsheb kauj vab thiab txuas lub hauv paus

Lub tshuab sib tsoo tau siv los txiav lub log tsheb kauj vab tawm ntawm lub tsheb kauj vab thiab txuas cov hlau hlau txhawm rau txhawm rau txhawm rau lub log.

Kauj Ruam 5: Tshaj Tawm Cov Duab Kawg thiab Lub Tswv Yim

Sketching Cov Duab Kawg thiab Lub Tswv Yim
Sketching Cov Duab Kawg thiab Lub Tswv Yim
Sketching Cov Duab Kawg thiab Lub Tswv Yim
Sketching Cov Duab Kawg thiab Lub Tswv Yim
Sketching Cov Duab Kawg thiab Lub Tswv Yim
Sketching Cov Duab Kawg thiab Lub Tswv Yim

Peb khaws ib zaj los ua daim duab zaum kawg. Vim hais tias nthwv dej ntawm zaj zoo li sawv cev zoo tshaj plaws los ntawm cov txiaj ntsig tom qab.

Kauj Ruam 6: Txiav Txim Duab

Ua Tsiv Duab Txiav
Ua Tsiv Duab Txiav
Ua Tsiv Duab Txiav
Ua Tsiv Duab Txiav

Faib cov duab ua peb ntu uas yuav haum rau txhua lub tsheb kauj vab thiab faib tag nrho 12 cov duab los ntawm cov xim thiab cov lus tsa suab.

Kauj Ruam 7: Npaj Software

Software Npaj
Software Npaj
Software Npaj
Software Npaj

Sub ntu 1. Nruab Arduino

Arduino Rub tawm:

(Nruab kom haum rau koj li OS version thiab system.)

-

Sub ntu 2. Nruab lub tsev qiv ntawv

*(Yog tias koj xav teeb tsa los ntawm Github, thov mus saib qhov txuas saum toj no Github Arduino Library:

1. Khiav Arduino program

2. Tso cai txuas cov ntawv qhia saum toj kawg nkaus - kos duab - suav nrog tsev qiv ntawv - ntxiv. Zip tsev qiv ntawv

3. Koj yuav tsum xaiv. Zip cov ntaub ntawv uas twb tau teeb tsa github library4

*(Yog tias koj xav siv Arduino cov kev pabcuam pabcuam)

1. Khiav cov program Arduino

2. Tso cai txuas cov ntawv qhia saum toj kawg nkaus - kos duab - suav nrog tsev qiv ntawv - tswj tsev qiv ntawv - tshawb 'Adafruit neopixel' - koj tuaj yeem pom 'Adafruit Neopixel los ntawm Adafruit'

3. Nruab thiab hloov kho tsev qiv ntawv

-

Sub ib feem 3. Nruab qhov program hloov pauv

1. Txhim Kho Txoj Kev Hloov Kho Vaj Huam Sib Luag (R. C. P):

2. Koj yuav tsum tau nyeem daim ntawv README

Kauj Ruam 8: Ua Cov Khoom Siv Hluav Taws Xob

Ua Cov Khoom Siv Hluav Taws Xob
Ua Cov Khoom Siv Hluav Taws Xob
Ua Cov Khoom Siv Hluav Taws Xob
Ua Cov Khoom Siv Hluav Taws Xob
Ua Cov Khoom Siv Hluav Taws Xob
Ua Cov Khoom Siv Hluav Taws Xob

*Nov yog yuav ua li cas muab Arduino 5V qhov hluav taws xob los ntawm lub roj teeb. Thov ua raws cov theem hauv qab no.

1. Txuas Lithium roj teeb thiab JBATT charging module. (Rau kev siv, JBATT module muaj lub zog hloov hluav taws xob.)

2. Txuas lub davhlau ya nyob twg ntawm JBATT mus rau Vin davhlau ya nyob twg ntawm Arduino thiab av davhlau ya nyob twg.

3. Txuas Micro 5pin usb chaw nres nkoj mus rau lub chaw nres nkoj them nyiaj txhawm rau txheeb xyuas yog tias cov khoom tau ua haujlwm raug.

4. Tom ntej no, tig lub built-in hloov mus rau ON.

5. Yog tias lub teeb liab coj teeb thiab lub teeb ntsuab coj teeb hauv Arduino, cov khoom lag luam theem teeb tsa tau ua tiav ib txwm muaj.

Kauj Ruam 9: Ua Kho I/O & Txheeb Xyuas OUTPUT (NeoPixel Ua Haujlwm)

Ua Kho Vajtse I/O & Txheeb Xyuas OUTPUT (NeoPixel Ua Haujlwm)
Ua Kho Vajtse I/O & Txheeb Xyuas OUTPUT (NeoPixel Ua Haujlwm)
Ua Kho Vajtse I/O & Txheeb Xyuas OUTPUT (NeoPixel Ua Haujlwm)
Ua Kho Vajtse I/O & Txheeb Xyuas OUTPUT (NeoPixel Ua Haujlwm)
Ua Kho Vajtse I/O & Txheeb Xyuas OUTPUT (NeoPixel Ua Haujlwm)
Ua Kho Vajtse I/O & Txheeb Xyuas OUTPUT (NeoPixel Ua Haujlwm)

*Ntu no suav nrog lub sensor thiab theem tso tawm

1. Txuas Arduino thiab Hall sensors. Cov ntaub ntawv tus pin txuas rau Arduino tus pin 2.

2. Thaum Arduino tau txhawb zog thiab cov hlau nplaum nyob ze nrog Hall sensor, lub teeb liab yuav ci.

3. Txuas Arduino thiab Neopixel. Tsuas yog 30 Neopixels siv.

4. Txuas cov ntaub ntawv tus pin nrog Arduino tus pin 6.

5. Txuas Arduino thiab rub kab ntawv txuas rau koj lub khoos phis tawj usb chaw nres nkoj thiab khiav Arduino ntawm koj lub computer.

6. Xaiv Tool - board - “Arduino / Genuino Mega lossis Mega 2560” los ntawm cov ntawv qhia zaub mov saum toj kawg nkaus ntawm Arduino program.

7. Txheeb xyuas yog tias muaj cov npe khoom uas tuaj yeem txuas ncaj qha rau ntawm qhov chaw nres nkoj. Yog tias nws tsis raug tshuaj xyuas, nyem rau xaiv nws.

8. Muab tshuaj txhuam cov cai hauv qab no thiab nyem Upload nyob rau sab saum toj sab laug. (Tom qab ntawd, txhua qhov program rub tawm ua raws cov kauj ruam 5-8.)

9. Kev teeb tsa tiav thaum tag nrho 30 neoled pixels qhib.

#1. suav nrog header file thiab preprocessing

Ua ntej peb yuav tsum nqa lub tsev qiv ntawv Adafruit_NeoPixel uas tuaj yeem ua Neopixels.

Lub tsev qiv ntawv tuaj yeem siv los ntawm kev tshaj tawm cov khoom.

Adafruit_NeoPixel chav kawm tuaj yeem nkag 3 qhov ntsuas nyob hauv zej tsoom.

Thawj qhov ntsuas yog tus naj npawb ntawm LEDs.

qhov ntsuas ntsuas thib ob yog tus lej tus lej txuas nrog Neopixel cov lej nkag.

Qhov ntsuas thib peb yog kev xaiv cov tswv yim raws li cov yam ntxwv khoom. peb-xim WS2812b cov khoom siv 'NEO_GRB' cov tswv yim

#suav nrog

#define PIN 6 Adafruit_NeoPixel strip = Adafruit_Neopixel (30, PIN, NEO_GRB+NEO_KHZ800);

#2. teeb

Hauv qhov teeb tsa ib feem, pib qhov khoom thiab npaj nws rau kev siv.

'Adafruit_Neopixle_Object.begin ()' teeb tsa tag nrho cov LEDs kom tua.

'Adafruit_Neopixle_Object.show ()' tso tawm nrog qhov ci ci teeb tsa hauv LED.

void teeb tsa () {

strip.begin (); strip.show (); }

#3. lub voj loj

Qhov kev ua ntawm lub voj loj siv lub voj rau ua ntu zus (0.1 vib nas this) LEDs dawb

void voj () {

rau (uint16_t i = 0; kuv <strip.numPixels (); i ++) {strip.setPixelColor (i, 255, 255, 255); strip.show (); ncua (100); }}

Kauj Ruam 10: Sib dhos thiab Txuas rau Lub Log

Sib dhos thiab Txuas rau Lub Log
Sib dhos thiab Txuas rau Lub Log
Sib dhos thiab Txuas rau Lub Log
Sib dhos thiab Txuas rau Lub Log

1. Txuas Neopixels. (Ua tib zoo saib tus lej tus lej)

2. Txuas Hall Sensor. (Xa mus rau Kauj Ruam 9)

3. Txuas tus ncej rau Arduino nruab nrab ntawm cov tsheb kauj vab. (Txuas cov ntaub ntawv Arduino mus rau lub thav duab tsheb kauj vab).

4. Ntxig rau Arduino txuas nrog Neopixel. (Ceev faj vim rab phom kua nplaum kub).

5. Ntxig rau qhov ntsuas nrog Hall sensor rau hauv Arduino, (Ruaj cov hlua khi kom lub Hall sensor tsis poob).

6. Cov laug los txuas roj teeb. (Ceev faj thaum koj muab tshuaj txhuam).

7. Kho nws nrog rab yaj phom. (Txuas tus qauv them nyiaj ntawm lub roj teeb kom ruaj ntseg chaw).

8. Txuas txhua kab ua ntej txuas rau Arduino, 9. Ntsaws raws li txhua tus lej tus lej. (Txuas cov kab dhia rau kev them nqi tsis tas yuav ua rau lawv tsis meej pem).

10. Ua kom tiav nrog rab yaj phom ib zaug, (Thov ceev faj tsis txhob poob).

Kauj Ruam 11: Txheeb INPUT (HALL Sensor Data)

Txheeb xyuas INPUT (HALL Sensor Cov Ntaub Ntawv)
Txheeb xyuas INPUT (HALL Sensor Cov Ntaub Ntawv)
Txheeb xyuas INPUT (HALL Sensor Cov Ntaub Ntawv)
Txheeb xyuas INPUT (HALL Sensor Cov Ntaub Ntawv)
Txheeb xyuas INPUT (HALL Sensor Cov Ntaub Ntawv)
Txheeb xyuas INPUT (HALL Sensor Cov Ntaub Ntawv)

*Txheeb xyuas software software kom pom tias lub ntsuas cua ua haujlwm li cas.

1. Muab tshuaj txhuam thiab xa cov cai hauv qab no.

2. Nyem rau Serial Monitor khawm nyob rau sab xis saum toj ntawm Arduino.

3. Thaum cov hlau nplaum nyob hauv kev sib cuag nrog Hall sensor ntau dua 1 thib ob, kev teeb tsa tiav thaum lo lus "tiv tauj sib nqus" tshwm ntawm daim ntawv saib.

----------------------------------------------------------------------- ----------------------------------------------------------------------- ----------------------------------------------------------------------- #1. Txhais tus lej tus lej thiab teeb tsa

Thawj qhov teeb tsa tus lej tus lej siv Hall sensor thiab teeb tus lej tus lej ua qhov Chaw Nkag Nkag nkaus xwb.

Teem kev sib txuas lus txhawm rau txheeb xyuas cov ntaub ntawv ntawm Hall sensor ntawm tus saib xyuas.

#define HALL 2

teeb tsa tsis muaj dab tsi () {pinMode (HALL, INPUT); Serial.begin (9600); }

#2. lub voj loj

Txheeb xyuas Hall cov ntaub ntawv ntawm 0.1 vib nas this ib ntus.

Yog tias cov hlau nplaum tau hnov thiab hloov pauv cov ntaub ntawv, "kev sib cuag sib nqus" tau tso tawm rau lub ntsuas saib.

void voj () {

yog (digitalRead (HALL)) {Serial.println ("tiv tauj sib nqus"); } ncua (100); }

Kauj Ruam 12: Coding Algorithm

*Tsim cov laj thawj thiab cov lej los tswj Neopixels raws li qhov ntsuas qhov ntsuas.

1. Muab tshuaj txhuam thiab xa cov cai hauv qab no.

2. Nws yog ib txwm rau cov duab tsis raug tso tawm kom raug vim tias tsis muaj cov thav duab tsim. Tab sis koj tuaj yeem pom nws ua haujlwm ntxhib.

3. Ceev nrooj kov thiab tso lub Hall sensor thiab cov hlau nplaum hauv 1 thib ob. Rov ua qhov haujlwm no txog 10 zaug.

4. Kev teeb tsa tiav thaum cov xim ntawm Neopixels hloov tsis tu ncua.

#1. Xws li cov ntawv header thiab kev npaj ua ntej

Ua ntej, peb yuav tsum nkag siab tias Arduino Mega lub cim xeeb tsis loj txaus los tuav cov duab.

Yog li ntawd, 'avr/pgmspace' header file tau siv los siv qhov chaw nco sib txawv.

Txhawm rau siv Neopixels, koj tshaj tawm cov khoom thiab teeb tsa tus lej I/O tus lej.

Cov duab duab loj dhau rau kev sau npe, yog li rub tawm thiab muab cov ntawv txuas nrog.

#suav nrog

#include #define PIN 6 #define NUMPIXELS 30 #define HALL 2 Adafruit_NeoPixel strip = Adafruit_NeoPixel (NUMPIXELS, PIN, NEO_RGB + NEO_KHZ800); // paste array hauv 'image_array_1.txt' // "'image_array_2.txt' //" 'image_array_3.txt' // "'image_array_4.txt'

#2. Kev hloov pauv thoob ntiaj teb & teeb tsa

Teeb lub ntiaj teb sib txawv.

Qhov tseem ceeb yog teeb tsa qhov ci ci, nws tau txiav txim siab lub neej-voj voog ntawm cov khoom.

int suav = 0;

ob v = 0; ob lub xeem_v = 0; ob npaug timer = micros (); ob npaug ex_timer = micros (); ob npaug kawg_timer = micros (); int cov = 36; txp = 35; rgb ib = 3; ob q_arr [2] = {0, 0}; int HALL_COUNT = 0; ob VELO; ua ob zaug_timer = micros (); teeb tsa tsis muaj dab tsi () {strip.setBrightness (255); strip.begin (); strip.show (); Serial.begin (230400); }

#3. lub voj loj - duab qhia tawm ib feem

Txoj cai no yog nqe lus hais txog yuav ua li cas tso tawm lub sijhawm lub log tig los ntawm kev daws teeb meem.

Qhov no siv lub voj voog tig lub log tsheb kauj vab ib zaug uas yog qhov ntsuas tseem ceeb heev.

Tsis tas li, nws yog ib qho tseem ceeb kom nyeem cov duab cov ntaub ntawv los ntawm kev nco.

void voj () {

yog ((suav (ex_timer / 120.0) - (micros () - processing_timer)))) {timer = micros (); yog (VELO> 360000) {rau (int i = 0+5; i <pix; i ++) {strip.setPixelColor (i - 5, strip. Color (pgm_read_byte (& (image_1 [suav] [1]))), pgm_read_byte (& (image_1 [suav] [2])), pgm_read_byte (& (image_1 [suav] [0]))))) } strip.show (); } lwm yog (VELO 264000) {rau (int i = 0+5; kuv <pix; i ++) {strip.setPixelColor (i - 5, strip. Color (pgm_read_byte (& (image_2 [suav] [1]), pgm_read_byte (& (image_2 [suav] [2])), pgm_read_byte (& (image_2 [suav] [0]))))) } strip.show (); } lwm tus yog (VELO 204000) {rau (int i = 0+5; i <pix; i ++) {strip.setPixelColor (i - 5, strip. Color (pgm_read_byte (& (image_3 [suav] [1]), pgm_read_byte (& (image_3 [suav] [2])), pgm_read_byte (& (image_3 [suav] [0]))))) } strip.show (); } lwm yog (VELO <= 204000) {rau (int i = 0 + 5; i = 120)) {rau (int i = 0 + 5; i <pix; i ++) {strip.setPixelColor (i - 5, strip. Color (0, 0, 0)); } strip.show (); }

#4. lub ntsiab lus tseem ceeb - ua thiab ntsuas lub sijhawm ntsuas & ntsuas

Qhov no yog qhov tseem ceeb tshaj plaws ntawm tag nrho cov kab ke.

Ua ntej, txheeb xyuas lub sijhawm coj los ua kom tiav tag nrho cov cai thiab hloov kho LED lub sijhawm tso tawm ib lub hlis.

Lub sijhawm hnov txhua lub sijhawm uas lub log tig los kwv yees lub sijhawm ntawm lub voj voog tom ntej.

Kev nrawm tuaj yeem kwv yees tau los ntawm kev rho tawm lub sijhawm ntsuas ntsuas kawg ntawm lub sijhawm ntsuas lub sijhawm.

Lub kaw lus suav lub sijhawm ua haujlwm thiab ua kom nrawm los laij ntev npaum li cas cov LEDs tig mus tas li.

processing_timer = micros ();

yog ((digitalRead (HALL) == HIGH) && (HALL_COUNT == 1)) {VELO = v; v = micros () - last_timer; ex_timer = q_arr [0] - q_arr [1] + v; last_timer = micros (); q_arr [0] = q_arr [1]; q_arr [1] = v; suav = 0; HALL_COUNT = 0; } lwm tus yog (digitalRead (HALL) == LOW) {HALL_COUNT = 1; }}

Kauj Ruam 13: Siv Software

Siv Software
Siv Software
Siv Software
Siv Software
Siv Software
Siv Software

*Siv software los hloov cov duab thiab ntxig cov ntaub ntawv txheej txheem rau hauv txoj cai

1. Ntxig cov duab los ntawm cov kauj ruam saum toj no rau hauv daim nplaub tshev duab hauv R. C. P nplaub tshev uas tau teeb tsa hauv kauj ruam npaj.

- Yuav ua li cas tso cov duab yog raws li hauv qab no.- Hloov 4 cov duab ua yeeb yaj kiab ntawm cov khoom # 1 raws li 1.png, 2.png, 3.png, thiab 4.png.- Hloov 4 cov duab ua yeeb yam ntawm cov khoom # 2 nyob rau hauv kev txiav txim ntawm 5.png, 6.png, 7.png, 8.png.- Hloov 4 cov duab ua yeeb yaj kiab ntawm Cov Khoom # 3 nyob rau hauv kev txiav txim ntawm 9.png, 10.png, 11.png, 12.png.

2. Khiav Ver.5.exe ntawv.

3. Txheeb xyuas tias 12 cov ntaub ntawv pro_1_code_1.txt rau pro_3_code_4.txt tau tsim hauv R. C. P nplaub tshev.

4. Yog tias nws tsis tau tsim, hloov cov ntsiab lus ntawm config.txt raws li cov ntawv teeb tsa hauv qab no.

5. Thaum cov ntaub ntawv raug tsim, theej tag nrho cov ntsiab lus los ntawm cov ntaub ntawv pro_1_code_1.txt thiab muab nws tso rau hauv ib feem uas qhia hauv cov cai hauv qab no.

6. Ntxiv cov pro_1_code_2.txt, pro_1_code_3.txt, thiab cov ntsiab lus pro_1_code_4.txt rau cov cim hauv ntu thib 5.

7. Xa mus rau 5 thiab 6, pro_2_code…, pro_3_code ua tiav txoj cai ib yam nkaus.

Kauj ruam 14: Ua kom tiav

Ua tiav
Ua tiav
Ua tiav
Ua tiav
Ua tiav
Ua tiav

Ua tiav kev tsim POV uas tsim ib daim duab nrog peb lub log.

Pom zoo: