Cov txheej txheem:

Arduino & Neopixel Coke Lub Raj Dej Zaj sawv Lub Teeb: 7 Kauj Ruam (nrog Duab)
Arduino & Neopixel Coke Lub Raj Dej Zaj sawv Lub Teeb: 7 Kauj Ruam (nrog Duab)

Video: Arduino & Neopixel Coke Lub Raj Dej Zaj sawv Lub Teeb: 7 Kauj Ruam (nrog Duab)

Video: Arduino & Neopixel Coke Lub Raj Dej Zaj sawv Lub Teeb: 7 Kauj Ruam (nrog Duab)
Video: Огромный OLED экран 2.42" на контроллере SSD1309, обзор и подключение к Arduino 2024, Hlis ntuj nqeg
Anonim
Image
Image

Yog li kuv tus tub Doon pom lub teeb pom kev zoo heev ua los ntawm cov fwj cawv coke qub thiab cov khoom noj sab hauv ntawm Glow Sticks, thiab nug yog tias peb tuaj yeem ua ib qho rau nws qhov kev xeem tom ntej hauv Tsev Kawm Ntawv Tshaj Tawm Ua Phem YAWG !!! Kuv hais tseeb, tab sis tsis yog koj yuav muaj qee qhov zoo li Adafruit Neopixel Rings uas peb tau nyeem txog … Nws muab qhov muag tsis pom rau kuv. Vim tias qhov tseeb nws tsis paub kuv tab tom tham txog dab tsi, tab sis Dad tau pom lub sijhawm los ua si nrog cov Neopixel rings Nws tau nyeem txog, thiab peb txhua tus paub ib qho ntawm 10 qhov laj thawj tshaj plaws uas geek txiv tsim yog kom muaj zam txim rau ua si nrog cov cuab yeej txias uas lawv qhia rau txhua tus yog rau lawv cov menyuam.

Nov yog qhov haujlwm yooj yim super uas zoo nkaus li zoo heev. Peb tau tsim peb li ntawm 3 lub raj mis coke qub, phaj ntoo, thiab cov chaw ua si tom qab lub tog raj kheej - cov khoom nyob ib puag ncig hauv qab daus - ua ke nrog Arduino (Leonardo hauv peb kis, tab sis ib pawg Board Genuino yuav ua!) Thiab peb Neopixel rings. Kuv xaj ib lub nplhaib 9-LED, tab sis xaus nrog lub nplhaib 12-LED rau tus nqi ib yam. Uas yog qab zib, tab sis txhais tau tias ua tiav ntawm lub qhov dej zoo-lub 12-LED rings yog 35mm dav, tsis zoo li 23mm. Koj yuav xav tau dab tsi:

  • Genuino/Arduino board (Peb siv Leonardo, tab sis yuav luag txhua lub rooj tsavxwm yuav ua)
  • 3 Neopixel rings (12 LEDs txhua): tau txais los ntawm Adafruit, thiab txhawb nqa cov neeg zoo
  • 1000 µf 6.3v lossis zoo dua capacitor
  • 300-500 ohm resistor
  • Ib lub phaj ntoo, lossis ib lub xwmfab ntawm cov ntoo, lossis txhua yam uas koj tuaj yeem teeb tsa neopixels rau hauv thiab zaum lub raj mis coke rau saum
  • Qee qhov kev teeb tsa rau lub phaj - chaw ua si tom chaw ua haujlwm tau ua haujlwm zoo rau peb
  • 9v cog w
  • 40mm qhov-borer
  • Bolts, Ceev, Washers, Spacers
  • Cov tub ntxhais hlau
  • Ib tug soldering hlau thiab solder
  • Cov qhob cij
  • Ib rooj plaub yas rau Arduino. Koj tuaj yeem tawm mus thiab yuav cov hnab yas uas zoo tshaj plaws tsim los ntawm lab xyoo cov roj av tau tawm hauv av hauv qee qhov chaw tsis zoo thiab tsim tawm ntawm lwm sab ntawm lub ntiaj chaw thiab xa hauv lub thawv mus rau lub tsev rau khoom ze koj nrog txhua cov chaw nres nkoj txiav tawm hauv kev sib dhos zoo tshaj plaws thiab xa nws mus rau koj lub qhov rooj los ntawm lub tsheb thauj cov pa roj carbon dioxide mus rau qhov chaw. Lossis koj tuaj yeem ua qhov kuv tau ua thiab siv lub thawv yas pov tseg qub.. qhov no yog Madagascar pab pab lub thawv nyob ib puag ncig hauv lub txee tshuaj … thiab laum ob peb qhov hauv nws. Nov yog qhov kawg ntawm kev qhuab qhia. Cia peb ua …

Kauj Ruam 1: Ua Lub Hauv Paus

Ua lub hauv paus
Ua lub hauv paus
Ua lub hauv paus
Ua lub hauv paus

Koj tuaj yeem tsim kho koj lub hauv paus los ntawm cov khib nyiab uas koj tau txais hauv koj tus kheej hauv qab daus, lossis txawm tias tsuas yog siv lub thawv ntoo lossis txhua yam uas yuav zais koj cov khoom siv hluav taws xob.

Ua ntej peb tau hlais peb lub qhov, sib nrug ntawm cov phaj ntoo, loj txaus rau Neopixel rings los zaum. Thaum kawg, vim tias qhov loj dua ntawm 12-LED rings, peb yuav tsum tau xaum qhov nrog lub qhov me ntsis. Qhov no txhais tau tias mus txhua txoj hauv kev los ntawm lub phaj, thiab tsis txhob siv lub nplhaib kom zoo rau hauv lawv cov khoom siv tes ua me me 2mm-tob qhov dej nrog lub qhov hauv nruab nrab rau qhov xaim hlau khiav zoo kuv tau ua tiav kev ruaj ntseg nrog … ahem … Cov kab xev hla hauv qab ntawm phaj. Tsis txhob txiav txim. Koj tsis tuaj yeem pom hauv qab ntawm lub phaj hauv kuv tus qauv tsim lawm. Thiab nws tsaus ntuj thaum nws nyob. Thiab dua li - dab tsi tsis ncaj ncees nrog cov kab xev?

Kuv xav tau kev tshem tawm ntawm lub phaj thiab tus tuav rau lub khob cij rau hauv qab ntawm lub phaj thiab ib qho kev tiv thaiv - lub tshuab hluav taws xob, thiab rau cov xaim khiav uas yuav tsum tau mus ntawm lub khob cij mus rau Arduino, uas kuv tau npaj yuav muab tso rau sab hauv. Yog li kuv muab cov khoom sib hloov me me rau ntawm cov ntsia liaj qhov rooj kom muab kev tshem tawm kom txaus - li 3cm, qhov siab ntawm daim txiag ntoo thiab me ntsis kom koj tsis txhob tsoo qhov thaiv. Kuv tau siv ob lub tog ntoo txuas rau ib lub ces kaum vim tias lawv yog qhov siab raug thiab nyob ib puag ncig hauv tus txiv neej tub rau khoom … lub thawv xoob xauv, ntsia liaj qhov rooj, ntsia hlau, xeb txuas-txuas, txuas txuas, npib qub, cov khoom tsis xav tau, thiab txhua yam ntawm cov khoom thiab bobs uas tuaj yeem cawm koj txoj kev mus rau tom khw kho vajtse los ntawm kev muab, yog tias tsis yog yam koj xav tau, qee yam uas yuav ua tau zoo xwb.

Kev sib tsoo zoo siab txog qhov chaw ua si tom qab kuv pom hauv qab daus yog nws muaj qhov ntws los ntawm lub phaj lawm. Tsis tas yuav laum hlau! Lub hauv paus muaj plaub qhov ntsia liaj qhov rooj, thiab peb drilled plaub lub qhov rooj sib tsoo hauv cov ntoo ntoo kom phim.

Peb tom qab ntawd tsuag-pleev xim rau txhua yam Gothic Dub.

Kauj Ruam 2: Npaj Neopixel Rings

Npaj Neopixel Rings
Npaj Neopixel Rings

Koj yuav tsum tau txuas cov xov hlau mus rau koj lub neopixel rings: Cov Ntaub Ntawv-Hauv xov hlau rau txhua tus ntawm lawv, Cov Ntaub Ntawv-Tawm xov hlau rau ob ntawm lawv, thiab lub zog thiab hauv av rau txhua tus. Txawm ntev npaum li cas koj xav tias koj xav tau, ntxiv qee qhov. Koj tuaj yeem txiav tawm cov xov hlau ntau dhau, koj tsis tuaj yeem ncab ib qho uas luv dhau. Thiab paub txog kev ceeb toom los ntawm Adafruit:

Thaum siv cov xaim hluav taws xob txuas rau cov nplhaib no, koj yuav tsum tau ceev faj ntxiv txog cov kab laug sab laug thiab cov kab hluav taws xob luv. Qhov sib nrug ntawm cov khoom siv yog nruj heev! Nws yog qhov yooj yim tshaj plaws los ntxig cov hlau los ntawm lub hauv ntej thiab cov laug rau tom qab.

Kuv cia siab tias kuv tau nyeem qhov ntawd ua ntej kuv yuav laug rau sab xub ntiag. Kuv tswj tsis tau hlawv ib qho ntawm kuv cov LEDs, tab sis kuv tau hlawv ib sab ntawm ib txoj hauv kev uas ua rau kuv tawm hws mus txog thaum kuv qhib nws. Tsis tas li, yog kuv tau nyeem phau ntawv qhia zoo kuv kuj tseem tau nyeem cov lus ceeb toom tsis txhob muab tus nab kuab tso rau ntawm LED. Cia kuv lub nkoj puas tsuaj ze ze yog koj lub lighthouse.

Neopixel rings daisy-saw, uas txhais tau tias koj tuaj yeem tswj hwm lawv txhua tus LEDs ib txhij los ntawm Arduino los ntawm kev txuas xov hlau los ntawm OUT ntawm ib lub nplhaib mus rau IN ntawm lwm qhov. Txhua lub nplhaib xav tau lub zog thiab cov xov hlau hauv av ib yam.

Kauj Ruam 3: Kev Txuas Hluav Taws Xob

Qhov thaiv
Qhov thaiv

Hlau nws zoo li nws Fritzing saum toj no-tus pin 6 ntawm Arduino nqa cov ntaub ntawv mus rau thawj lub nplhaib, Cov Ntaub Ntawv-tawm los ntawm lub nplhaib ntawd mus rau Cov Ntaub Ntawv-hauv tom ntej, Cov Ntaub Ntawv-tawm ntawm qhov ntawd mus rau Cov ntaub ntawv-hauv lub nplhaib kawg. Koj tsis xav tau cov ntaub ntawv-tawm xaim ntawm lub nplhaib zaum kawg.

Lub peev xwm 1000 µf mus nruab nrab ntawm qhov zoo thiab tsis zoo ntawm txoj kab ntawm lub khob cij. Lub hau no tiv thaiv cov nplhaib los ntawm lub zog loj thiab tau pom zoo los ntawm Adafruit NeoPixel Uberguide qhov kev coj ua zoo tshaj plaws. Tus tiv thaiv ntawm Cov Ntaub Ntawv hauv thawj neopixel kuj tau pom zoo los ntawm Adafruit-nws yog 1K hauv Fritzing tab sis pom zoo tiv thaiv yog 300-500 ohms.

Hauv kuv qhov kev tsim, Kuv tau khiav cov xov hlau los ntawm Neopixels hla sab nraum qab ntawm lub phaj mus rau lub khob cij nyob hauv nruab nrab. Txoj kev ntawd koj tsuas yog yuav tsum khiav peb lub xov hlau ntev mus rau hauv lub hauv paus: lub zog, hauv av, thiab cov ntaub ntawv. Kuv tau ua cov xov hlau ntev ntev-muaj ntau qhov chaw cia hauv lub hauv paus, thiab nws ua rau nws yooj yim kom tuaj yeem rub lub rooj tsavxwm tawm rau kev rov ua dua tshiab.

Kauj ruam 4: Txoj Cai

"thau khoom =" tub nkeeg "hais txog kuv tus tub xav tau suab paj nruag-reactive version ntawm no. Coj mus txog nws lub hnub nyoog 18 xyoo kom tau nyob ib puag ncig rau nws, tab sis ntawm no nws yog!

Cov khoom siv ntxiv:

1 Ib tus ncej, Muab Ob Tog Hloov 1 Tsis Siv Neeg Tau Txais Mic (Kuv siv AdaFruit's MAX9184) 1 1uF-100uF capacitor (Txhua tus nqi)

Lub microphone tiag tiag yuav tsum muaj Kev Siv Tau Txais Kev Tswj kom qhov no ua haujlwm tau zoo. AGC yuav niaj hnub ua piv txwv txog lub suab nrov ib puag ncig thiab nce thiab nqis qis dua uas nws suav tias yog keeb kwm yav dhau, yog li koj lub teeb yuav teb rau qhov cuam tshuam rau tom qab ntawd. AdaFruit lub mic yog qhov ci ntsa iab: koj tuaj yeem mus los ntawm chav nyob ntsiag to uas lub suab ntawm ib lub suab yuav ua rau nws mus rau tag nrho-ntawm tog hom nrog chav uas muaj cov tub ntxhais hluas thiab suab paj nruag nrov nrov, thiab nws yuav khaws cov suab paj nruag nkaus xwb nplua. Lwm txoj hauv kev, Adjustable Gain Mic, muaj lub zog me me ntawm lub rooj tsavxwm uas tsis yooj yim sua thiab ua tsis tau. Nws tsis siv ntau qhov hloov pauv hauv lub suab ib puag ncig kom ua rau chav tsis muaj txiaj ntsig: teeb ntawm tas li lossis tsaus ntuj tas li. AGC ua haujlwm zoo li khawv koob.

Kuv xav tau qhov kev xaiv los siv tus qauv ntsuas swirl lossis suab paj nruag, yog li kuv txuas lub hauv paus ntawm kev hloov pauv mus rau VIN thiab ib qho txuas rau tus pin 4 lwm tus rau tus pin 8 ntawm Leonardo. Los ntawm kev ntsuas cov pins rau HIGH lossis LOW peb tuaj yeem paub tias lub xeev hloov pauv nyob rau hauv, thiab cov cai raws li.

Kauj Ruam 7: Txuas Xov Tooj Microphone

Kev Txuas Txuas Microphone
Kev Txuas Txuas Microphone

Pub Mic lub tswv yim, ntawm qhov 1-100µF capacitor, rau hauv Analogue Pin 0. Yog tias koj lub capacitor yog polarized, tus pin tawm mus rau sab zoo (Green wire).

Ua tsaug rau CodeGirlJP rau nws Trinket-Color-by-Sound niaj hnub, uas kuv yoog raws li hauv qab no:

// Lub suab qhib LEDs nrog Arduino thiab NeoPixels

#suav nrog

#define MIC_PIN A0 // Microphone tau txuas rau tus pin a0 ntawm Leonardo

#define LED_PIN 6 // NeoPixel LED txoj hlua txuas rau tus pin 6 ntawm Leonardo #define N_PIXELS 36 // tus lej ntawm cov kab hauv LED !!!!!! Kho kom tus lej ntawm pixels hauv koj teeb. Qhov no yog qhov raug rau 3 Neopixel rings !!!!!! #define N 100 // Tus naj npawb ntawm cov qauv coj ua txhua lub sijhawm nyeem Cov qauv piv txwv hu ua #define fadeDelay 5 // ncua sijhawm rau txhua qhov ploj mus #define suab nrov Qib 30 // nqes hav theem nruab nrab mic suab tsis muaj suab

// Pib ua NeoPixel sawb nrog cov txiaj ntsig tau teev tseg saum toj no:

Adafruit_NeoPixel strip = Adafruit_NeoPixel (N_PIXELS, LED_PIN, NEO_GRB + NEO_KHZ800);

cov qauv [N]; // cia rau cov qauv sau ua ke

int periodFactor = 0; // khaws cov lej ntawm ms rau lub sijhawm suav ua int t1 = -1; // sijhawm ntawm txoj kab nqes> 100 pom. tus T; // lub sijhawm nruab nrab ntawm lub sijhawm ntsuas rau milliseconds int nqes hav; // txoj kab nqes ntawm ob qhov khaws cov ntaub ntawv piv txwv cov ntsiab lus byte periodChanged = 0; const int SwitchPinMusic = 4; // Pin rau hloov txoj hauj lwm suab paj nruag-rhiab const int SwitchPinSwirl = 8; // Pin rau hloov txoj haujlwm Xeem Txawv (swirl) int MusicbuttonState = 0; // On off logic variable rau suab paj nruag rhiab heev

// Txoj kev teeb tsa Arduino

void teeb tsa () {

strip.begin ();

ledsOff (); ncua (500); displayColor (Log (100)); strip.show (); ncua (500); oddWheel (Log (100)); strip.show (); ncua (500); pinMode (SwitchPinMusic, INPUT); pinMode (SwitchPinSwirl, INPUT); // attachInterrupt (4, Hloov, Ua Tsis Tau);

}

// Arduino voj txoj kev

void loop () {SwirlbuttonState = digitalRead (SwitchPinSwirl); // HIGH yog hloov teeb rau Music rhiab MusicbuttonState = digitalRead (SwitchPinMusic); // HIGH yog tias hloov teeb rau Kev Ntsuas Qauv thaum (SwirlbuttonState == LOW) {readSamples (); // Khiav cov suab paj nruag piv txwv li niaj zaus SwirlbuttonState = digitalRead (SwitchPinSwirl); // Txheeb xyuas yog qhov hloov pauv} SwirlbuttonState = digitalRead (SwitchPinSwirl); MusicbuttonState = digitalRead (SwitchPinMusic); thaum (SwirlbuttonState == HIGH) {Dance (); // Khiav qhov kev ntsuas swirly niaj hnub siv SwirlbuttonState = digitalRead (SwitchPinSwirl); // Txheeb xyuas yog tias qhov hloov pauv

}

}

void Dance () {

thaum (SwirlbuttonState == HIGH) {colorWipe (strip. Color (255, 0, 0), 50); // Red SwirlbuttonState = digitalRead (SwitchPinSwirl); colorWipe (strip. Color (0, 255, 0), 50); // Green SwirlbuttonState = digitalRead (SwitchPinSwirl); colorWipe (strip. Color (0, 0, 255), 50); // Xiav SwirlbuttonState = digitalRead (SwitchPinSwirl); //colorWipe(strip. Color(0, 0, 0, 255), 50); // Dawb RGBW // Xa lub tsev ua yeeb yam pixel caum hauv… SwirlbuttonState = digitalRead (SwitchPinSwirl); theatreChase (strip. Color (127, 127, 127), 50); // Dawb SwirlbuttonState = digitalRead (SwitchPinSwirl); theatreChase (strip. Color (127, 0, 0), 50); // Red SwirlbuttonState = digitalRead (SwitchPinSwirl); theatreChase (strip. Color (0, 0, 127), 50); // Xiav SwirlbuttonState = digitalRead (SwitchPinSwirl); zaj sawv (20); SwirlbuttonState = digitalRead (SwitchPinSwirl); zaj sawv (20); SwirlbuttonState = digitalRead (SwitchPinSwirl); theatreChaseRainbow (50); SwirlbuttonState = digitalRead (SwitchPinSwirl); }} // Nyeem thiab Txheej Txheem Piv Txwv Cov Ntaub Ntawv los ntawm Mic void readSamples () {rau (int i = 0; i0) {nqes hav = piv txwv - piv txwv [i -1]; } lwm {txoj kab nqes = piv txwv - piv txwv [N -1]; } // Txheeb xyuas yog tias nqes hav ntau dua noiseLevel - suab uas tsis nyob ntawm qib suab nrov pom yog (abs (nqes hav)> noiseLevel) {yog (nqes hav <0) {calculPeriod (i); yog (periodChanged == 1) {displayColor (getColor (T))); }}} lwm tus {ledsOff (); // theatreChaseRainbow (50); } periodFactor += 1; ncua (1); }}

void calculPeriod (int kuv)

{yog (t1 == -1) {// t1 tsis tau teev t1 = i; } lwm { / t1 tau teeb tsa calc lub sijhawm int lub sijhawm = periodFactor*(i - t1); periodChanged = T == ncua sijhawm? 0: 1; T = sij hawm; //Serial.println(T); // pib dua t1 rau tshiab kuv tus nqi t1 = i; periodFactor = 0; }}

uint32_t getColor (lub sijhawm int)

{yog (lub sij hawm == -1) rov Log (0); lwm qhov yog (lub sijhawm> 400) rov Log (5); lwm yam rov Log (daim ntawv qhia (-1*lub sijhawm, -400, -1, 50, 255)); }

tsis muaj dab tsi fadeOut ()

{rau (int i = 0; i <5; i ++) {strip.setBrightness (110 - i*20); strip.show (); // Hloov kho ncua sijhawm ncua (fadeDelay); periodFactor += fadeDelay; }}

tsis muaj dab tsi fadeIn ()

{strip.setBrightness (100); strip.show (); // Hloov kho kab txaij // ploj xim rau (int i = 0; i <5; i ++) {//strip.setBrightness(20*i+30); //strip.show (); // Hloov kho ncua sijhawm ncua (fadeDelay); periodFactor+= fadeDelay; }}

void ledsOff ()

{fadeOut (); rau (int i = 0; i

void displayColor (uint32_t xim)

{rau (int i = 0; i

void oddWheel (uint32_t xim)

{rau (int j = 0; j <256; j ++) {// hloov txhua 256 xim hauv lub log rau (int q = 0; q <3; q ++) {rau (uint16_t kuv = 24; i <36; i = i+3) {strip.setPixelColor (i+q, Log ((i+j) % 255))); // tig txhua pixel thib peb ntawm} strip.show ();

ncua (1);

rau (uint16_t i = 24; i <36; i = i+3) {strip.setPixelColor (i+q, 0); // tig txhua peb pixel tawm}}} fadeIn (); }

// Sau cov dots ib qho tom qab ib qho nrog xim

void colorWipe (uint32_t c, uint8_t tos) {rau (uint16_t kuv = 0; i

tsis muaj zaj sawv (uint8_t tos) {

uint16_t kuv, j;

rau (j = 0; j <256; j ++) {rau (i = 0; i

// Sib txawv me ntsis, qhov no ua rau zaj sawv sib npaug faib thoob plaws

void rainbowCycle (uint8_t tos) {uint16_t kuv, j;

rau (j = 0; j <256*5; j ++) {// 5 mus ntawm txhua xim ntawm lub log rau (i = 0; kuv <strip.numPixels (); i ++) {strip.setPixelColor (i, Log (((kuv * 256 / strip.numPixels ()) + j) & 255)); } strip.show (); ncua (tos); }}

// Theatre-style crawling teeb.

void theatreChase (uint32_t c, uint8_t tos) {rau (int j = 0; j <10; j ++) {// ua 10 cycles ntawm kev nrhiav rau (int q = 0; q <3; q ++) {rau (uint16_t kuv = 0; kuv <strip.numPixels (); kuv = i+3) {strip.setPixelColor (i+q, c); // tig txhua pixel thib peb ntawm} strip.show ();

ncua (tos);

rau (uint16_t i = 0; kuv <strip.numPixels (); kuv = i+3) {strip.setPixelColor (i+q, 0); // tig txhua pixel thib peb tawm}}}}

// Theatre-style crawling teeb nrog zaj sawv nyhuv

void theatreChaseRainbow (uint8_t tos) {rau (int j = 0; j <256; j ++) {// hloov txhua 256 xim hauv lub log rau (int q = 0; q <3; q ++) {rau (uint16_t kuv = 0; kuv <strip.numPixels (); i = i+3) {strip.setPixelColor (i+q, Log ((i+j) % 255))); // tig txhua pixel thib peb ntawm} strip.show ();

ncua (tos);

rau (uint16_t i = 0; kuv <strip.numPixels (); kuv = i+3) {strip.setPixelColor (i+q, 0); // tig txhua pixel thib peb tawm}}}}

// Sau tus nqi 0 txog 255 kom tau txais tus nqi xim.

// Cov xim yog qhov hloov pauv r - g - b - rov qab rau r. uint32_t Log (byte WheelPos) {WheelPos = 255 - WheelPos; yog (WheelPos <85) {rov qab strip. Color (255 - WheelPos * 3, 0, WheelPos * 3); } yog (WheelPos <170) {WheelPos -= 85; rov qab strip. Color (0, WheelPos * 3, 255 - WheelPos * 3); } WheelPos -= 170; rov qab strip. Color (WheelPos * 3, 255 - WheelPos * 3, 0); }

void Switched () {

strip.show (); readSamples (); }

Ua ntej kuv tau raug tua nyob rau hauv cov lus (nco txog Txoj Cai Zoo Zoo !!) Kuv tau pom tom qab kuv tau tshaj tawm qhov no li cas qee qhov ntawm kuv tus lej yog. Tsis tas yuav tsum tau ntsuas tas li Pin 4 thiab Pin 8 rau HIGH. Raws li qhov hloov pauv yog Ib tus ncej pov ob zaug, tus nqi ntawm ib tus tuaj yeem txiav txim siab los ntawm lwm qhov: koj tsuas yog yuav tsum sim ib qho. Yog li koj tuaj yeem hla dhau thiab tshem tawm txhua qhov kev siv los nyeem thiab sau MusicButtonState thiab tsuas yog ua txhua yam kom muaj txiaj ntsig zoo los ntawm kev sim SwirlButtonState, yog tias koj muaj lub cim xeeb tsawg lossis txuas nrog lwm txoj haujlwm. Tab sis cov cai saum toj no ua haujlwm.

Thiab yog tias leej twg xav hloov kho cov kev ua suab no kom nkag siab tsis yog tsuas yog suab nrov tab sis zaus ib yam nkaus, thiab sau qee tus lej yooj yim kom xaub nce thiab nqis lub teeb pom kev zoo hauv cov lus teb kom txav mus raws lub suab nrov, tso qhov txuas hauv cov lus rau koj ua li cas.

Txaus siab rau!

Pom zoo: