Cov txheej txheem:
- Kauj Ruam 1: Cov Khoom Siv
- Kauj ruam 2: Txoj Cai
- Kauj ruam 3: Pib Circuit Court
- Kauj Ruam 4: ULN2803
- Kauj ruam 5: Ntxiv Suab
- Kauj Ruam 6: Xaus
Video: Suab paj nruag Fairy Teeb: 6 Kauj Ruam (nrog Duab)
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:30
Los ntawm IanCummingFollow Ntau los ntawm tus sau:
Txog: Kuv nyiam ua khoom los ntawm foob pob hluav taws mus rau hluav taws xob. Xav paub ntau ntxiv txog IanCumming »
Zoo Siab Txais Tos Nej Txhua Tus
Nws yuav luag txog lub caij lom zem thiab cov khw tau pib tso tawm lawv cov khoom ua si lom zem, Kuv xav tias nws txog lub sijhawm los tsim qee cov suab paj nruas zoo nkauj!
Kauj Ruam 1: Cov Khoom Siv
Kuv yuav siv cov hauv qab no:
- 12 LEDs
- 12 Tam sim no txwv cov Resistors
- 1 ULN 2803 Darlington Transistor Array
- Qee qhov Jumper Wires
- Ib tus neeg hais lus piezo
- Breadboard thiab
- ib Arduino
- Txhawm rau ua txoj hlua ntawm lub teeb zoo nkauj kuv tau siv 5 xaim los ntawm Ethernet cable
Kauj ruam 2: Txoj Cai
// GLOBAL VARS int barTime = 1200; // 8/8 = 1000ms byte nrLEDS = 4; // 4 Lub hauv paus LEDs, Koj tuaj yeem ntxiv ntau qhov sib npaug byte leds = {3, 4, 5, 6}; byte hais lus = 11; byte patternLength = 64; // qauv Ntev byte songLength = 51; const byte nkauj = {// Jingle Bells Cov Ntaub Ntawv 29, 2, 29, 2, 29, 4, 29, 2, 29, 2, 29, 4, 29, 2, 32, 2, 25, 3, 27, 1, 29, 8, 30, 2, 30, 2, 30, 3, 30, 1, 30, 2, 29, 2, 29, 2, 29, 2, 27, 2, 27, 2, 27, 2, 29, 2, 27, 4, 32, 4, 29, 2, 29, 4, 29, 4, 29, 2, 29, 4, 29, 2, 32, 2, 25, 3, 27, 1, 29, 8, 30, 2, 30, 2, 30, 2, 30, 2, 30, 2, 29, 2, 29, 2, 29, 1, 32, 2, 32, 2, 30, 2, 27, 2, 25, 8}; // Tus Qauv yog Tus Zauv Naj Npawb ces // Nco Ntsoov hauv 8th's const byte pattern = {// Cov Ntaub Ntawv Txawv 0b0001, 0b0010, 0b0100, 0b1000, // Cov khoom corrispond rau Leds hauv Array 0b0001, 0b0010, 0b0100, 0b1000, 0b0001, 0b0010, 0b0100, 0b1000, 0b0001, 0b0010, 0b0100, 0b1000, 0b1000, 0b1000, 0b1100, 0b0100, 0b0110, 0b0010, 0b0011, 0b0001, 0b1001, 0b1000, 0b1100, 0b0100, 0b010, 010, 010, 010, 010, 010 0b1010, 0b0101, 0b1010, 0b0101, 0b1010, 0b0101, 0b1010, 0b0101, 0b1010, 0b0101, 0b1010, 0b1010, 0b0101, 0b1100, 0b0011, 0b1100, 0b1100, 0b1100, 0b1100, 0b1100, 0b1100, 0b0011, 0b1100, 0b0011, 0b1100, 0b0011,};
Ua ntej tshaj tawm kuv tshaj tawm kuv qhov kev hloov pauv, qhov txaus nyiam yog Nkauj thiab Txawv.
- Zaj nkauj khaws cov nkauj; qhov no nws yog Jingle tswb.
- Tus qauv khaws cia rau thiab tawm txoj haujlwm hauv cov khoom ntawm qhov tseem ceeb hauv kab.
Kev Cai Ua Haujlwm
// FUNCTIONS int noteToHz (int note) {// Hloov Cov Lus Cim Nr. rau Zaus ntab freq = 440 * (pow (1.059463094359, nco-21)); // -21 muab rau koj nco 1 ntawm C3 (Kuv Xav) rov int (freq); // Cov txiaj ntsig tau raug rau 1hz} tsis muaj teeb pom kev zoo LEDs (byte PORT_X) {// Tswj LED Lub Xeev rau (int q = 0; q
Ob txoj haujlwm kuv muaj yuav ua cov hauv qab no:
- Xam qhov zaus rau lub suab ua haujlwm hauv lub voj
- hloov lossis tua LED's nyob ntawm tus nqi dhau mus rau txoj haujlwm
Teeb muaj nuj nqi
void teeb () {// teeb tsa OUTPUT pins pinMode (hais lus, OUTPUT); rau (int t = 0; t <nrLEDS; t ++) {pinMode (leds [t], OUTPUT); }}
Hauv qhov teeb tsa teeb tsa kuv teeb tus pin xav tau rau OUTPUT.
Loop Muaj nuj nqi
void loop () {// Music Loop rau (int t = 0; t <songLength; t ++) {// Notes, Ntev thiab ua suab paj nruag int note = noteToHz (nkauj [t * 2]); int ntev = ((nkauj [(t * 2) +1] * barTime) / 8); suab nrov (hais lus, nco, ntev - 50); // Teeb nyem! lightLEDs (qauv [t % patternLength]); ncua (ntev); } // Silence Loop int randomSilence = random (1000, 5000); rau (int t = 0; t
Kuv muaj 2 lub voj nyob rau hauv Loop Main muaj nuj nqi. Lub suab nkauj thiab lub suab ntsiag to
Lub suab nkauj yuav nyeem cov ntaub ntawv los ntawm kab ntawv nkauj, ua si qhov kev ceeb toom siv lub suab nrov ua haujlwm
Lub suab nkauj yuav,
- Nyeem cov ntaub ntawv los ntawm kab nkauj,
- Ua si daim ntawv siv lub suab nrov ua haujlwm
- Teeb lub LED's, nyeem cov qauv qauv.
Hauv Silence loop
tsuas yog cov LED tau teeb
Plug Arduino rau hauv thiab xa cov cai. (Tom qab ntawd tshem nws)
Kauj ruam 3: Pib Circuit Court
Kuv yuav pib tawm nrog txoj hlua teeb
- Kuv siv xaim los ntawm Ethernet cable thiab txuas 3 LED's ua ke plaub zaug, ua kom pom qhov chaw tawm ntawm tus LED tusyees li ntawm 2 meters
- Kuv tau siv lub Anode ntawm txhua tus coj mus rau ib qho xaim.
- Tom qab ntawd Cathode ntawm txhua LED rau 4 cais cov xov hlau. Nrog ib tug resistor ntawm chav kawm
- Kuv rov ua cov txheej txheem no 3 zaug kom tau ib txoj hlua ntawm 12 LED thiab kuv muab lub taub hau txuas rau qhov kawg ntawm 5 xov hlau
Txuas Qhov Zoo thiab cov kab hauv av mus rau lub khob cij
Kauj Ruam 4: ULN2803
Muab ULN2308 Chip tso rau ntawm daim txiag ntoo
ULN2308 yog transistor array nti; los ntawm cov ntaub ntawv kuv tuaj yeem pom
- Tus pin 1 yog lub tswv yim uas tig tus pin 18 "ON"
- Pin 2 puv 17. Lwm yam
- Pin 9 yog av
- Txuas Pin 9 ntawm lub nti rau hauv av tsheb nqaj hlau
- Txuas txoj kev tsheb ciav hlau zoo mus rau lub dav hlau dav hlau, ib txoj hlua hla tus pin 18. (Koj yuav pom yog vim li cas hauv ib pliag)
- Txuas tus pin 1 ntawm lub nti rau tus pin 3 ntawm Arduino
- 2 mus rau 4
- 3 ntawm lub nti mus rau 5 thiab
- 4 mus rau tus pin 6 ntawm Arduino
- Muab cov hlua LED tso rau ntawm daim ntawv ci. Qhov twg cov xaim hluav taws xob sib txuas tau txuas nrog cov hlua txuas nrog 5 volts. Tus so ntawm lub teeb pom kev zoo yuav tsum mus rau tus pin 18, 17, 16 thiab 15 ntawm lub nti.
Kauj ruam 5: Ntxiv Suab
- Txuas lub Piezo Speaker ntawm 2 lub dav hlau dav hlau
- Txuas tus ncej tsis zoo ntawm Piezo keeb rau hauv av thiab
- Lwm qhov kawg ntawm tus hais lus rau tus pin 11
Kauj Ruam 6: Xaus
Kuv muaj txoj hlua ntawm lub teeb uas yuav ua suab nrov nrov nrov nrov kom nco kuv tias nws yog lub caij lom zem.
Pom zoo:
Suab paj nruag React Fiber Optic Star Qab nthab Teeb: 11 Cov Kauj Ruam (nrog Duab)
Suab paj nruag React Fiber Optic Star Qab nthab Teeb: Xav tau ib daim ntawm galaxy ntawm koj lub tsev? Nrhiav nws seb nws ua li cas hauv qab no! Tau ntau xyoo nws yog kuv txoj haujlwm npau suav thiab thaum kawg Nws tau ua tiav. Nws siv sijhawm qee lub sijhawm los ua kom tiav, tab sis qhov txiaj ntsig kawg tau txaus siab heev uas kuv ntseeg tias nws tsim nyog. Me ntsis
Suab paj nruag Reactive Mood Teeb: 5 Cov Kauj Ruam (nrog Duab)
Music Reactive Mood Lights: Intro and Background.Back in freshman year (Caij nplooj ntoos hlav xyoo 2019), Kuv xav ua kom kuv chav pw tsis tu ncua. Kuv tuaj nrog lub tswv yim ntawm kev tsim kuv tus kheej lub teeb pom kev uas yuav cuam tshuam rau cov nkauj uas kuv tau mloog ntawm kuv lub mloog pob ntseg. Hais ncaj ncaj, Kuv tsis muaj kev tshoov siab tshwj xeeb
Suab paj nruag Rhythm LED Flash Lub Teeb: 9 Kauj Ruam (nrog Duab)
Music Rhythm LED Flash Light: Hauv qhov haujlwm no, peb yuav ua Lub Suab Nkauj Rhythm LED Flash Light Circuit siv Microphone thiab BC547 ntawm lub khob cij thiab PCB qhov twg cov hlua coj teeb yuav ntsais nrog lub suab paj nruag. hluav taws xob
Suab Paj Nruag Painting Canvas Nrog Makey Makey: 9 Kauj Ruam (nrog Duab)
Suab paj nruas Painting Canvas Nrog Makey Makey: Nyob zoo, hauv Cov Lus Qhia no peb yuav kawm paub yuav ua li cas los pleev xim pleev xim rau Canvas, uas yog, cov nkauj sib txawv suab txhua lub sijhawm peb pleev xim nrog txhuam ntawm txhua xim. Nov yog qhov lom zem heev thiab ua haujlwm los txhawb kev pleev xim rau cov menyuam yaus lossis tseem muab qhov tshwj xeeb
Menorah suab paj nruag (ua nrog Arduino): 13 Cov Kauj Ruam (nrog Duab)
Menorah suab paj nruag (ua nrog Arduino): Chanukah yuav los sai sai! Yog li kuv xav tias nws yuav yog ib lub tswv yim zoo los ua ib qhov haujlwm ntsig txog hnub so. Kuv ua qhov Chanukah Menorah txias no nrog Arduino uas ua nkauj sib txawv txhua lub sijhawm koj hloov hmo ntuj los ntawm nias lub pob. Cov LEDs