Cov txheej txheem:

Wearable Tech Final Project - DJ Helmet: 6 Kauj Ruam
Wearable Tech Final Project - DJ Helmet: 6 Kauj Ruam

Video: Wearable Tech Final Project - DJ Helmet: 6 Kauj Ruam

Video: Wearable Tech Final Project - DJ Helmet: 6 Kauj Ruam
Video: I wear the last one everyday... ๐Ÿ‘จ๐Ÿผโ€๐Ÿš€ 2024, Hlis ntuj nqeg
Anonim
Wearable Tech Final Project - DJ Kaus mom
Wearable Tech Final Project - DJ Kaus mom

Lub hom phiaj ntawm txoj haujlwm no yog ua kom DJ lub kaus mom hlau nrog LEDs rov ua suab paj nruag rau kev ua yeeb yam thiab qhov zoo. Peb tab tom siv cov kab ntawv hais tawm ntawm Amazon.com nrog rau lub kaus mom hlau maus taus, ib qho Arduino uno thiab xaim.

Khoom siv

Cov ntaub ntawv suav nrog:

  • Addressable LED sawb
  • Maus taus kaus mom hlau
  • Arduino Ib
  • Cov hlau thiab cov hlau txuas

Kauj Ruam 1: Tau txais LEDs kom rov hnov suab

Rau thawj kauj ruam peb tab tom sim ntsuas cov kab hluav taws xob LED kom hnov lub suab, peb siv lub suab los ntawm Sparkfun thiab txuas nws mus rau Arduino siv lub khob cij thiab xaim. Kev sim tawm nrog Arduino software, peb tau txais ob qhov nyeem peb tuaj yeem siv tau. Qhov dav ntawm lub suab los ntawm "Chaw Xa Ntawv" chaw nres nkoj thiab binary 1 /0 nyeem los ntawm "rooj vag" chaw nres nkoj. Siv qhov kev hloov pauv no los ua daim duab qhia chaw rau kab lus coj mus hais qhia, tom qab ntawd "rooj vag" nyob ntawm ib qho, LEDS tso saib qee yam xim, thaum Lub Hnab Ntawv nyob siab dua ib qib, tso saib ib qho xim. Yuav muab tag nrho cov cai.

Kauj Ruam 2: Txiav thiab Solder LEDS kom Zoo Li Lub kaus mom hlau

Txiav thiab Solder LEDS kom Zoo Li Lub kaus mom hlau
Txiav thiab Solder LEDS kom Zoo Li Lub kaus mom hlau
Txiav thiab Solder LEDS kom Zoo Li Lub kaus mom hlau
Txiav thiab Solder LEDS kom Zoo Li Lub kaus mom hlau
Txiav thiab Solder LEDS kom Zoo Li Lub kaus mom hlau
Txiav thiab Solder LEDS kom Zoo Li Lub kaus mom hlau

Ntawm kuv qhov haujlwm kuv txiav txim siab ntxiv LEDs rau lub kaus mom hlau nyob rau hauv X zam nrog cov duab peb sab ntxiv rau sab nraud, Kuv npaj yuav ua kom cov qauv tsim ntawd ua haujlwm zoo dua nrog cov nkauj ua si. Yog li cov kauj ruam no yog txhua yam hais txog kev txiav cov hlua LED mus rau qhov xav tau ntev thiab muab lawv sib dhos ua ke ntawm cov cim txiav kom ua cov ces kaum. Kuv yuav tsum ua qhov no txog 10 zaug thiab nws siv sijhawm heev tshwj xeeb tshaj yog thaum cuam tshuam nrog cov xov hlau me. Nov yog kev nce qib ntawm cov kauj ruam no

Kauj Ruam 3: Hlau thiab Kuaj Cov LEDs ntawm Lub Kaus mom

Hlau thiab Xeem cov LEDs ntawm Lub Kaus mom hlau
Hlau thiab Xeem cov LEDs ntawm Lub Kaus mom hlau
Hlau thiab Xeem cov LEDs ntawm Lub Kaus mom hlau
Hlau thiab Xeem cov LEDs ntawm Lub Kaus mom hlau

Hauv cov kauj ruam no kuv txuas thiab ntsuas cov LEDs rau arduino, lub suab board thiab txiav LEDs kom ntseeg tau tias kev txiav thiab cov laug siv tau ua haujlwm raug.

Kauj Ruam 4: Cov Khoom Siv Hluav Taws Xob Dawb Los Ntawm Breadboard

Dawb Electronics Los Ntawm Breadboard
Dawb Electronics Los Ntawm Breadboard
Dawb Electronics Los Ntawm Breadboard
Dawb Electronics Los Ntawm Breadboard
Dawb Electronics Los Ntawm Breadboard
Dawb Electronics Los Ntawm Breadboard

Hauv theem no kuv tsom mus rau kom tau txais txhua yam khoom siv hluav taws xob tawm ntawm lub khob cij. Kuv tau muab tag nrho cov xov hlau uas xav tau los txuas thiab txuas cov xov hlau kaus mom kom ntev dua yog li koj tuaj yeem hnav lub kaus mom hlau wile txuas rau Arduino. Qhov tseem ceeb tshaj plaws uas kuv tsis tuaj yeem paub yog lub zog sab nraud, kuv tau sim roj teeb hauv kev teeb tsa sib txawv tab sis tsis muaj dab tsi yuav muab qhov txiaj ntsig rau kuv uas kuv xav tau, qee qhov yuav ua rau lub teeb mus vwm thiab qee qhov yuav ua rau lawv txawv xim. Hmoov tsis qhov no yuav yog vim kuv paub txog kev siv hluav taws xob tab sis kuv tau xaiv los khaws lub zog rau Arduino los ntawm lub pc board. Lub suab board tau siv los ntawm lub roj teeb pob thiab uas ua haujlwm zoo

Kauj ruam 5: Kawg Configuration

Kawg Configuration
Kawg Configuration

rau cov kauj ruam kawg no, Kuv tau nyeem qhov txiaj ntsig los ntawm lub rooj tsav xwm suab thiab hloov kho qhov chaws kom haum rau qhov txiaj ntsig tshiab uas hloov pauv ib yam txhua yam raug tshem tawm ntawm lub khob cij. Kuv tau kaw cov hlua LED mus rau lub kaus mom hlau ua ntej lawv tau kaw thiab thaum kawg kuv tau sim dua.

Kauj Ruam 6: Txoj Cai (Arduino)

// NeoPixel Ring yooj yim kos duab (c) 2013 Shae Erisson

// Tshaj tawm nyob rau hauv daim ntawv tso cai GPLv3 kom phim rau lwm qhov

// Adafruit NeoPixel lub tsev qiv ntawv

#suav nrog

#ifdef _AVR_ #include // Yuav tsum tau rau 16 MHz Adafruit Trinket #endif

// Tus pin twg ntawm Arduino txuas nrog NeoPixels?

#define PIN 3 // Ntawm Trinket lossis Gemma, qhia hloov qhov no mus rau 1

// Muaj pes tsawg NeoPixels txuas rau Arduino?

#define NUMPIXELS 166 // Nrov nrov NeoPixel lub nplhaib loj

Adafruit_NeoPixel pixels (NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);

#define DELAYVAL 500 // Lub Sijhawm (hauv milliseconds) kom ncua ntawm cov pixels

void teeb tsa () {

#if txhais (_ AVR_ATtiny85_) && (F_CPU == 16000000)

clock_prescale_set (clock_div_1); #endif // Xaus ntawm Trinket-tshwj xeeb cov cai.

pixels.begin (); // INITIALIZE NeoPixel strip khoom (YUAV TSUM)

Serial.begin (9600); }

void voj () {

int sensorValue = analogRead (A1);

int sensorValue2 = digitalRead (7); Serial.println (sensorValue); // ncua (5); //pixels.clear (); // Teeb txhua lub xim pixel rau 'tawm'

yog (sensorValue2 == 1) {

rau (int i = 0; i <28; i ++) {pixels.setPixelColor (i, 15, 0, 50);

}

rau (int i = 48; kuv <81; i ++) {pixels.setPixelColor (i, 15, 0, 50);

}

rau (int kuv = 102; kuv <129; kuv ++) {pixels.setPixelColor (i, 15, 0, 50);

}

rau (int kuv = 148; kuv <166; kuv ++) {pixels.setPixelColor (i, 15, 0, 50); }} //////////////////////////// lwm yam {rau (int kuv = 0; kuv <28; kuv ++) {pixels.setPixelColor (kuv, 0, 0, 0);

}

rau (int i = 48; kuv <81; i ++) {pixels.setPixelColor (i, 0, 0, 0);

}

rau (int kuv = 102; kuv <129; kuv ++) {pixels.setPixelColor (i, 0, 0, 0);

}

rau (int kuv = 148; kuv <166; kuv ++) {pixels.setPixelColor (i, 0, 0, 0); }} //////////////////////////// if (sensorValue == 3 || sensorValue == 2) {rau (int i = 29; kuv <47; kuv ++) {pixels.setPixelColor (i, 255, 0, 0);

}

rau (int i = 82; kuv <101; i ++) {pixels.setPixelColor (i, 255, 0, 0);

}

rau (int i = 130; i <148; i ++) {pixels.setPixelColor (i, 255, 0, 0);

} pixels.show (); } yog (sensorValue> 3) {rau (int i = 29; i <47; i ++) {pixels.setPixelColor (i, 0, 155, 155);

}

rau (int i = 82; kuv <101; i ++) {pixels.setPixelColor (i, 0, 155, 155);

}

rau (int i = 130; i <148; i ++) {pixels.setPixelColor (i, 0, 155, 155);

}

pixels.show (); } lwm {rau (int kuv = 29; kuv <47; kuv ++) {pixels.setPixelColor (i, 0, 0, 0);

}

rau (int i = 82; kuv <101; i ++) {pixels.setPixelColor (i, 0, 0, 0);

}

rau (int i = 130; i <148; i ++) {pixels.setPixelColor (i, 0, 0, 0);} pixels.show (); }}

Pom zoo: