Cov txheej txheem:

Suab paj nruag Fairy Teeb: 6 Kauj Ruam (nrog Duab)
Suab paj nruag Fairy Teeb: 6 Kauj Ruam (nrog Duab)

Video: Suab paj nruag Fairy Teeb: 6 Kauj Ruam (nrog Duab)

Video: Suab paj nruag Fairy Teeb: 6 Kauj Ruam (nrog Duab)
Video: Lub Zog Nruab Nrog (Hmong Dubbed) 2024, Hlis ntuj nqeg
Anonim
Image
Image

Los ntawm IanCummingFollow Ntau los ntawm tus sau:

Arduino Intervalometer Cov
Arduino Intervalometer Cov
Tsis yog Sijhawm Teev Sijhawm
Tsis yog Sijhawm Teev Sijhawm
Tsis yog Sijhawm Teev Sijhawm
Tsis yog Sijhawm Teev Sijhawm
Ib lub Pixel Thermometer
Ib lub Pixel Thermometer
Ib lub Pixel Thermometer
Ib lub Pixel Thermometer

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

Qhov Siv
Qhov 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

Pib Circuit Court
Pib Circuit Court
Pib Circuit Court
Pib Circuit Court
Pib Circuit Court
Pib Circuit Court
Pib Circuit Court
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

TIAB SA 2803
TIAB SA 2803
TIAB SA 2803
TIAB SA 2803
TIAB SA 2803
TIAB SA 2803

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

Ntxiv Suab
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

Xaus
Xaus
Xaus
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: