Cov txheej txheem:

Siv LED Matrix Ua Tus Kuaj: 8 Kauj Ruam (nrog Duab)
Siv LED Matrix Ua Tus Kuaj: 8 Kauj Ruam (nrog Duab)

Video: Siv LED Matrix Ua Tus Kuaj: 8 Kauj Ruam (nrog Duab)

Video: Siv LED Matrix Ua Tus Kuaj: 8 Kauj Ruam (nrog Duab)
Video: Mathematics with Python! Evaluating Polynomials 2024, Kaum ib hlis
Anonim
Image
Image
Ua Boxy Cov Khoom Tawm ntawm Daim Npav Ua Lag Luam Qub!
Ua Boxy Cov Khoom Tawm ntawm Daim Npav Ua Lag Luam Qub!

Los ntawm marciotMarcioT's Home PageFollow Ntau los ntawm tus sau:

Ua Boxy Cov Khoom Tawm ntawm Daim Npav Ua Lag Luam Qub!
Ua Boxy Cov Khoom Tawm ntawm Daim Npav Ua Lag Luam Qub!
DIY 2.5x txog 5x Opera/Concert Glasses
DIY 2.5x txog 5x Opera/Concert Glasses
DIY 2.5x txog 5x Opera/Concert Glasses
DIY 2.5x txog 5x Opera/Concert Glasses
Tag Nrho Lub Tsev Wireless Dej Dej Ntes Ntes thiab Dej Kub Ceev Kaw Qhov System
Tag Nrho Lub Tsev Wireless Dej Dej Ntes Ntes thiab Dej Kub Ceev Kaw Qhov System
Tag Nrho Lub Tsev Wireless Dej Dej Ntes Ntes thiab Dej Kub Ceev Kaw Qhov System
Tag Nrho Lub Tsev Wireless Dej Dej Ntes Ntes thiab Dej Kub Ceev Kaw Qhov System

Txog: Kuv yog tus nyiam ua haujlwm nrog kev txaus siab rau qhov qhib software, luam ntawv 3D, tshawb fawb thiab khoom siv hluav taws xob. Thov mus ntsib kuv lub khw lossis nplooj ntawv Patreon los pab txhawb kuv txoj haujlwm! Xav paub ntau ntxiv txog marciot »

Lub koob yees duab digital zoo ib yam ua haujlwm los ntawm kev siv ntau lub teeb pom kev zoo txhawm rau ntes lub teeb raws li nws tau pom los ntawm ib yam khoom. Hauv qhov kev sim no, kuv xav pom seb kuv puas tuaj yeem tsim lub koob yees duab rov qab: tsis txhob muaj qhov teeb tsa ntawm lub teeb pom kev zoo, Kuv tsuas muaj ib lub sensor nkaus xwb; tab sis kuv tswj txhua ntawm 1, 024 tus neeg lub teeb pom kev hauv 32 x 32 LED matrix.

Txoj kev nws ua haujlwm yog tias Arduino taws teeb ib qho LED ib zaug, thaum siv cov lus sib piv los saib xyuas kev hloov pauv ntawm lub teeb pom kev zoo. Qhov no tso cai rau Arduino los ntsuas seb lub ntsuas puas tuaj yeem "pom" ib qho tshwj xeeb LED. Cov txheej txheem no tau rov ua dua rau txhua ntawm 1, 024 tus kheej LEDs sai sai los tsim daim duab qhia chaw ntawm pom kev pom.

Yog tias ib qho khoom tau muab tso nruab nrab ntawm LED matrix thiab lub sensor, Arduino muaj peev xwm ntes cov duab ntawm cov khoom ntawd, uas tau teeb raws li "duab ntxoov ntxoo" thaum qhov kev ntes tiav.

BONUS: Nrog rau kev hloov me me, tib tus lej tuaj yeem siv los ua "digital stylus" rau tha xim ntawm LED matrix.

Kauj Ruam 1: Cov Khoom Siv Hauv Qhov Tsim

Cov Khoom Siv Hauv Qhov Tsim
Cov Khoom Siv Hauv Qhov Tsim
Cov Khoom Siv Hauv Qhov Tsim
Cov Khoom Siv Hauv Qhov Tsim

Txog qhov haujlwm no, Kuv siv cov hauv qab no:

  • Ib Arduino Uno nrog Breadboard
  • 32x32 RGB LED matrix (xws li los ntawm AdaFruit lossis Tindie)
  • 5V 4A Lub Hwj Chim Adapter (los ntawm AdaFruit)
  • Poj niam DC Lub Hwj Chim Adapter 2.1mm nkaus rau Ntsia Hlau Terminal thaiv (los ntawm AdaFruit)
  • Qhov tseeb, 3mm TIL78 phototransistor
  • Jumper xov hlau

AdaFruit kuj muag ib qho Arduino daim ntaub thaiv uas tuaj yeem siv tau tsis yog cov xov hluav taws xob.

Raws li kuv muaj qee qhov Tindie cov qhab nia, Kuv tau txais kuv cov lej los ntawm Tindie, tab sis cov lej los ntawm AdaFruit zoo li zoo ib yam, yog li ib qho yuav tsum ua haujlwm.

Tus phototransistor tau los ntawm kuv lub xyoo dhau los cov khoom sau ua ntu zus. Nws yog qhov pom tseeb 3mm ntu sau ua TIL78. Raws li kuv tuaj yeem qhia, ntu ntawd yog txhais rau IR thiab los yog qhov xwm txheej meej lossis lub qhov tsaus ntuj uas thaiv qhov pom kev. Txij li thaum RGB LED matrix tso tawm lub teeb pom kev, qhov tseeb yuav tsum tau siv.

Qhov TIL78 no zoo li tau raug txiav lawm, tab sis kuv xav tias txoj haujlwm no tuaj yeem ua tau siv cov kws yees duab tam sim no. Yog tias koj pom qee yam uas ua haujlwm, qhia rau kuv paub thiab kuv yuav hloov kho Cov Lus Qhia no!

Kauj Ruam 2: Txuas Txuas thiab Kuaj Tus Kws Tshaj Lij Duab

Kev Txuas Hluav Taws Xob thiab Kev Ntsuas Tus Kws Tshaj Lij
Kev Txuas Hluav Taws Xob thiab Kev Ntsuas Tus Kws Tshaj Lij

Feem ntau, koj yuav xav tau tus tiv thaiv nyob rau hauv nrog cov phototransistor hla lub zog, tab sis kuv paub tias Arduino muaj lub peev xwm los pab kom muaj kev rub sab hauv sab hauv ntawm ib qho ntawm tus pin. Kuv xav tias kuv tuaj yeem siv qhov zoo los txhawm rau txhawm rau txuas tus kws yees duab rau Arduino yam tsis muaj cov khoom siv ntxiv. Nws muab tawm kuv qhov kev xav tau raug!

Kuv siv cov xov hlau txuas rau tus kws yees duab sib txuas rau GND thiab A5 pins ntawm Arduino. Tom qab ntawd kuv tsim cov duab kos uas teeb tsa tus pin A5 ua INPUT_PULLUP. Qhov no ib txwm ua tiav rau cov hloov pauv, tab sis qhov no nws muab lub zog rau tus kws yees duab xa hluav taws xob!

#Txheeb xyuas SENSOR A5

teeb tsa tsis muaj dab tsi () {Serial.begin (9600); pinMode (SENSOR, INPUT_PULLUP); } void loop () {// Nyeem qhov piv txwv tsis tu ncua thiab luam nws Serial.println (analogRead (SENSOR)); }

Cov duab kos no luam tawm qhov tseem ceeb mus rau qhov chaw nres nkoj txuas sib xws rau qhov pom kev ib puag ncig. Los ntawm kev siv qhov yooj yim "Cov phiaj xwm phiaj xwm" los ntawm "Cuab Yeej" ntawv qhia zaub mov ntawm Arduino IDE, Kuv tuaj yeem tau txais cov phiaj xwm txav ntawm qhov pom kev ib puag ncig! Raws li kuv npog thiab nthuav tawm tus kws yees duab nrog kuv txhais tes, cov phiaj xwm nce thiab nqis. Nyob zoo!

Cov duab no yog ib txoj hauv kev zoo los xyuas seb tus phototransistor tau txuas nrog txoj kab ncaj ncaj: tus phototransistor yuav nkag siab ntau dua thaum txuas ib qho kev coj mus rau lwm qhov.

Kauj Ruam 3: Txuas Txuas Cov Matrix Ribbon Cable mus rau Arduino

Txuas Txuas Cov Matrix Ribbon Cable mus rau Arduino
Txuas Txuas Cov Matrix Ribbon Cable mus rau Arduino

Txhawm rau xaim cov lej rau Arduino, Kuv tau hla phau ntawv qhia yooj yim no los ntawm Adafruit. Txhawm rau kom yooj yim, Kuv tau sau daim duab thiab pinouts rau hauv ib daim ntawv thiab luam tawm nplooj ntawv siv nrawm los siv thaum txuas txhua yam.

Saib xyuas kom ntseeg tau tias lub tab ntawm qhov txuas txuas ib qho hauv daim duab.

Xwb, rau lub voj voos huv, koj tuaj yeem siv RGB daim thaiv npog uas AdaFruit muag rau cov vaj huam sib luag no. Yog tias koj siv daim ntaub thaiv, koj yuav tsum tau muab cov laug txuas rau hauv lub taub hau lossis xov hlau rau tus kws yees duab.

Kauj Ruam 4: Txuas Matrix

Txuas Matrix
Txuas Matrix
Txuas Matrix
Txuas Matrix
Txuas Matrix
Txuas Matrix

Kuv ntsia ntsia lub diav rawg ntawm lub zog matrix ua rau lub adapter txuas, ua kom ntseeg tau tias qhov tseeb yog qhov tseeb. Txij li ib feem ntawm lub davhlau ya nyob twg raug tso tawm, Kuv qhwv txhua yam nrog kab xev hluav taws xob kom nyab xeeb.

Tom qab ntawd, Kuv tau ntsaws rau hauv lub txuas hluav taws xob thiab kab hlua, ua tib zoo saib kom tsis txhob cuam tshuam cov xov hlau jumper hauv tus txheej txheem.

Kauj Ruam 5: Nruab AdaFruit Matrix Library thiab Xeem Matrix

Nruab AdaFruit Matrix Library thiab Xeem Matrix
Nruab AdaFruit Matrix Library thiab Xeem Matrix

Koj yuav tsum tau teeb tsa "RGB matrix Panel" thiab AdaFruit "Adafruit GFX Library" hauv koj Arduino IDE. Yog tias koj xav tau kev pab ua qhov no, kev qhia yog txoj hauv kev zoo tshaj plaws mus.

Kuv qhia koj kom ua qee qhov piv txwv kom paub tseeb tias koj lub vaj huam sib luag RGB ua haujlwm ua ntej mus. Kuv pom zoo qhov piv txwv "plasma_32x32" vim nws zoo heev!

Nco tseg tseem ceeb: Kuv pom tias yog tias kuv tau txhawb nqa Arduino ua ntej kuv ntsaws rau hauv 5V cov khoom siv rau hauv cov lej, cov lej yuav ua rau pom kev tsaus ntuj. Nws zoo nkaus li tias lub matrix sim kos lub zog los ntawm Arduino thiab qhov ntawd yeej tsis zoo rau nws! Yog li kom zam dhau kev thauj Arduino ntau dhau, ib txwm txhawb lub zog ua ntej koj ua lub zog Arduino!

Kauj Ruam 6: Ntsuas Matrix Scanning Code

Qhov khoom plig thib ob hauv Arduino Contest 2019

Pom zoo: