Cov txheej txheem:
- Kauj Ruam 1: Yuav Tsum Kho Vajtse
- Kauj Ruam 2: Kev piav qhia ntau txoj kev hloov
- Kauj Ruam 3: Daim Npav Sib Piv
- Kauj Ruam 4: Ua Tune
Video: DIP Tune Selector Siv 1 Pin: 4 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:27
Ib pliag rov qab kuv tau ua haujlwm ntawm "lub thawv suab paj nruag" qhov haujlwm uas xav tau los xaiv ntawm ntau li 10 qhov sib txawv ntawm qhov sib dhos. Qhov kev xaiv ntuj rau xaiv lub suab tshwj xeeb yog 4 tus lej hloov pauv txij li 4 tus hloov pauv muab 24= 16 qhov sib txawv. Txawm li cas los xij, kev siv lub zog nruj rau txoj hauv kev no yuav tsum muaj 4 tus pin ntaus ntawv, ib qho rau txhua qhov hloov pauv. Txij li thaum kuv tau npaj siv ATtiny85 rau kev txhim kho, poob ntawm 4 tus pin yog me ntsis ntau dhau. Hmoov zoo, Kuv tau nkag mus rau hauv kab lus uas piav qhia txog txoj hauv kev zoo rau siv 1 tus lej sib piv los tswj ntau txoj kev hloov pauv.
Kev hloov pauv ntau; 1-cov txheej txheem nkag tau siv Voltage Divider Circuit los muab tus nqi sib txawv rau txhua qhov ntawm 16 qhov hloov pauv tau ua ke ua ke. Qhov teeb tsa ntawm 16 tus lej cim sib luag yog tom qab ntawd siv hauv cov ntawv thov kom koom nrog kev nqis tes ua nrog teeb tsa.
Cov lus qhia no ntiav cov txheej txheem hloov pauv ntau yam los siv ua suab nkauj xaiv rau lub thawv ntawv thov. Lub suab nkauj uas tau xaiv yog tom qab ntawd ua los ntawm piezo buzzer siv Arduino suab ua haujlwm.
Kauj Ruam 1: Yuav Tsum Kho Vajtse
Kev siv UNO raws li kev siv ua haujlwm tsawg tsawg tus naj npawb ntawm cov khoom siv kho vajtse uas xav tau. Kev siv ntau txoj kev hloov pauv qhov xav tau tsuas yog 4-pin dip switch, 5 resistors siv rau qhov faib hluav taws xob, thiab txuas xov hlau rau kev sib txuas. Lub piezo buzzer tau ntxiv rau kev teeb tsa rau kev siv ntawm lub npov suab paj nruag qhib tus xaiv. Kev xaiv, nyob ntawm seb hom kev hloov pauv siv, nws tau txais txiaj ntsig zoo siv 2x4 8 tus pin ntsaws los txuas lub dip hloov mus rau lub khob cij vim tias tus qauv dip dip pins zoo li tau ua rau soldering rau perfboard tsis ntsaws ncaj qha rau hauv lub khob cij. Lub qhov hluav taws xob ruaj khov rau qhov sib txuas hloov pauv thiab ua kom hloov pauv los ntawm kev yooj yim nqa thaum teeb tsa lub toggle keyboards.
Lub Npe | Tau Qhov Chaw Tau | Siv Li Cas |
---|---|---|
4-pin dip hloov | Qhib xaiv | |
2x4 tus pin qhov (Tsis teb los tau) | Amazon | Cov ntawv tshaj tawm feem ntau cov hloov pauv tsis tuav qhov hloov pauv tau zoo heev hauv lub khob cij. Lub qhov (socket) pab ua kom qhov kev sib txuas ruaj khov dua. Lwm txoj hauv kev yog txhawm rau nrhiav qhov hloov pauv uas tau ua tiag tiag rau lub khob cij siv nrog niaj zaus IC pins. |
resistors:
|
Siv qhov faib hluav taws xob | |
passive piezo buzzer | Amazon | Ua si suab paj nruag raws li tau tsav los ntawm daim ntawv thov ntawm Arduino lub suab ua haujlwm |
Kauj Ruam 2: Kev piav qhia ntau txoj kev hloov
Nqe lus no tham txog cov hauv paus ntsiab lus rau ntau txoj kev hloov pauv thiab txhim kho cov kab zauv uas xav tau rau kev suav ib leeg ntawm cov cim tshwj xeeb rau txhua qhov ntawm 16 qhov ua tau dip hloov teeb tsa teeb tsa. Cov cim no tuaj yeem siv rau hauv daim ntawv thov kev koom nrog kev hloov pauv teeb tsa nrog kev nqis tes ua. Piv txwv li, koj yuav xav tau teeb tsa - hloov 1 rau, hloov 2 tawm, hloov 3 tawm, hloov 4 tawm (1, 0, 0, 0) - los ua si Amazing Grace thiab (0, 1, 0, 0) ua si Tsov Rog Tsaus Ntuj Hmo No. Txog qhov ua kom luv thiab sib luag cov cim kev teeb tsa raug xa mus ua cov sib piv hauv cov seem ntawm daim ntawv.
Lub hauv paus ntsiab lus rau ntau txoj kev hloov pauv yog Voltage Divider Circuit uas muaj 2 hauv cov kab hluav taws xob txuas nrog rau qhov hluav taws xob nkag. Cov zis hluav taws xob ua hluav taws xob txuas nrog ntawm cov tiv thaiv, R1 thiab R.2, raws li qhia saum toj no. Qhov faib tawm qhov hluav taws xob tau suav raws li qhov hluav taws xob nkag tau sib npaug los ntawm qhov piv ntawm resistor R2 rau qhov sib npaug ntawm R.1 thiab R.2 (sib npaug 1). Qhov sib piv no ib txwm tsawg dua 1 yog li cov zis hluav taws xob ib txwm me dua li qhov hluav taws xob nkag.
Raws li qhia hauv daim duab tsim saum toj no ntau qhov hloov pauv tau teeb tsa ua qhov faib hluav taws xob nrog R2 tsau thiab R.1 sib npaug rau kev sib xyaw ua ke/sib npaug tiv thaiv rau 4 poob hloov pauv resistors. Tus nqi ntawm R1 nyob ntawm qhov twg cov hloov pauv tau qhib thiab, yog li ntawd, pab txhawb rau kev sib xyaw ua ke. Txij li thaum lub dip hloov resistors yog nyob rau hauv parallel, qhov sib npaug tsis kam suav qhov sib npaug tau teev tseg raws li qhov sib txawv ntawm cov khoom tiv thaiv tiv thaiv. Rau peb cov kev teeb tsa thiab rooj plaub uas txhua qhov hloov pauv tau qhib, qhov sib npaug ua
1/UA1 = 1/80000 + 1/40000 + 1/20000 + 1/10000
muab R1 = 5333.33 volts. Txhawm rau suav qhov tseeb tias feem ntau cov chaw muaj tsawg kawg ib qho ntawm cov kev hloov pauv, lub xeev hloov pauv tau siv los ua tus lej:
1/R ib1 = tus1*1/80000 + s2*1/40000 + s3*1/20000 + s4*1/10000 (2)
qhov twg lub xeev sib npaug, skuv, yog sib npaug rau 1 yog tias qhov hloov pauv tau qhib thiab sib npaug rau 0 yog tias qhov hloov pauv tau muab tua. R1 tam sim no tuaj yeem siv los xam qhov sib piv qhov xav tau hauv kab zauv 1. Siv cov ntaub ntawv uas txhua qhov hloov pauv tau ua raws li piv txwv ntxiv
RAWS = R2/(Rau1+R2) = 10000/(5333.33+10000) =.6522
Kauj ruam kawg hauv kev suav ntawm qhov kwv yees kwv yees tus nqi yog sib npaug ntawm RATIO los ntawm 1023 txhawm rau ua raws cov txiaj ntsig ntawm analogRead muaj nuj nqi. Tus cim rau rooj plaub uas txhua qhov hloov pauv tau nyob ntawd
sib piv15 = 1023*.6522 = 667
Txhua qhov sib npaug tam sim no nyob rau qhov chaw los suav cov cim rau 16 qhov hloov pauv tau. Los xaus:
- R1 yog xam siv kab zauv 2
- R1 thiab R.2 tau siv los laij cov feem cuam tshuam RATIO
- RATIO tau sib tw los ntawm 1023 kom tau txais tus lej sib piv
- xaiv tau, qhov kwv yees qhov hluav taws xob tuaj yeem suav ua RATIO*Vin
Cov txheej ntawm cov sib piv tsuas yog nyob ntawm qhov ntsuas qhov ntsuas siv rau qhov faib hluav taws xob thiab yog qhov kos npe tshwj xeeb rau kev teeb tsa. Vim tias qhov faib tawm qhov hluav taws xob yuav hloov pauv los ntawm kev khiav mus (thiab nyeem kom nyeem), tshwj xeeb hauv cov ntsiab lus no txhais tau tias thaum ob pawg ntawm tus cim yuav tsis zoo ib yam lawv nyob ze txaus uas cov khoom sib piv sib txawv poob hauv qhov me me ua ntej teev caij nyoog. Qhov loj me me ntsuas ntsuas yuav tsum tau xaiv loj txaus rau tus as khauj rau qhov xav tau hloov pauv tab sis me me txaus uas qhov sib txawv hloov chaw tsis sib tshooj. Feem ntau 7 ua haujlwm zoo rau lub sijhawm ib nrab-dav.
Ib pawg ntawm cov neeg sib piv rau kev teeb tsa tshwj xeeb tuaj yeem tau txais los ntawm ntau txoj hauv kev - khiav qhov program demo thiab sau cov txiaj ntsig rau txhua qhov teeb tsa; siv daim ntawv nthuav qhia hauv ntu tom ntej los xam; luam cov txheej uas twb muaj lawm. Raws li tau sau tseg saum toj no txhua qhov teeb tsa feem ntau yuav txawv me ntsis tab sis yuav tsum ua haujlwm. Kuv hais qhia siv txoj hauv kev sau tus lej cim rau kev hloov pauv ntau yam thiab daim ntawv nthuav tawm los ntawm ntu txuas ntxiv yog tias ib qho ntawm cov resistors tau hloov pauv ntau lossis ntau tus tiv thaiv ntxiv.
Cov kev qhia hauv qab no qhia txog kev siv cov sib piv los txheeb xyuas qhov hloov pauv tam sim no. Hauv txhua qhov phiaj xwm kev ua haujlwm analogRead tau ua tiav kom tau txais tus cim rau kev teeb tsa tam sim no. Tus lej cim no yog tom qab ntawd sib piv cov npe sib piv kom txog thaum pom qhov sib tw lossis cov npe ploj. Yog tias muaj kev sib tw pom cov lus tshaj tawm tau tshaj tawm rau kev txheeb xyuas; yog tias tsis pom kev ceeb toom tau tshaj tawm. Ib qho thib ob ncua sijhawm thib ob tau tso rau hauv lub voj kom lub qhov rooj tso tawm ntawm lub qhov rooj yuav tsis muaj kev cuam tshuam nrog cov lus thiab muab qee lub sijhawm los rov pib teeb tsa lub teeb hloov.
//-------------------------------------------------------------------------------------
// Demo program los nyeem qhov faib hluav taws xob tso tawm thiab siv nws los txheeb xyuas // hloov pauv tam sim no teeb tsa los ntawm kev saib cov txiaj ntsig tso tawm hauv ib qho array ntawm // sib piv qhov tseem ceeb rau txhua qhov teeb tsa tau. Cov txiaj ntsig hauv kev tshawb nrhiav tuaj yeem // ib qho tau txais los ntawm kev ua yav dhau los rau kev teeb tsa lossis los ntawm kev suav // raws qhov sib piv hauv qab. // ----------------------------------------------------------------------- -------------------------------------- int sib piv [16] = {0, 111, 203, 276, 339, 393, 434, 478, 510, 542, 567, 590, 614, 632, 651, 667}; // Txhais cov kev hloov pauv int dipPin = A0; // analog pin rau voltage divider input int dipIn = 0; // tuav cov faib hluav taws xob tso tawm txhais los ntawm analogRead int suav = 0; // loop counter int epsilon = 7; // sib piv luv ib nrab-dav bool dipFound = tsis tseeb; // muaj tseeb yog tias qhov hluav taws xob faib hluav taws xob tam sim no pom hauv saib lub rooj tsis muaj teeb tsa () {pinMode (dipPin, INPUT); // teeb tsa tus pin faib hluav taws xob ua INPUT Serial.begin (9600); // pab kom muaj kev sib txuas lus ib ntus} void loop () {ncua (3000); // khaws cov ntawv tso tawm los ntawm kev nrawm dhau // Pib pib saib tsis suav = 0; dipFound = tsis tseeb; // Nyeem thiab sau cov ntaub ntawv tam sim no tso zis hluav taws xob dipIn = analogRead (dipPin); Serial.print ("tso zis faib"); Serial.print (dipIn); // Tshawb nrhiav cov npe sib piv rau tus nqi tam sim no thaum ((suav <16) && (! DipFound)) {yog (abs (dipIn - sib piv [suav]) <= epsilon) {// pom nws dipFound = tseeb; Serial.print ("pom ntawm nkag"); Serial.print (suav); Serial.println ("tus nqi" + Txoj hlua (sib piv [suav])); tawg; } suav ++; } yog (! dipFound) {// tus nqi tsis nyob hauv rooj; yuav tsum tsis txhob tshwm sim Serial.println ("OOPS! Tsis pom; zoo dua hu rau Ghost Busters"); }}
Kauj Ruam 3: Daim Npav Sib Piv
Kev suav rau 16 tus lej sib piv tau muab hauv daim ntawv nthuav qhia saum toj no. Cov ntaub ntawv excel nrog tuaj yeem rub tawm rau hauv qab ntawm ntu no.
Kab ntawv sib kis kab ntawv A-D kaw qhov hloov pauv tus nqi tiv thaiv tus nqi thiab 16 qhov hloov pauv tau. Thov nco ntsoov tias khoos phis tawj DIP hloov pauv tau qhia hauv daim duab fritzing tsim tau suav los ntawm sab laug mus rau sab xis tsis yog sab xis mus rau sab laug tus lej uas qhia hauv daim ntawv nthuav qhia. Kuv pom qhov no me ntsis tsis meej pem tab sis lwm txoj hauv kev tsis tso qhov "1" teeb tsa (0, 0, 0, 1) thaum xub thawj ntawm cov npe. Kem E siv tus lej 2 ntawm ntu dhau los txhawm rau suav qhov Voltage Divider sib npaug tsis kam R1 rau qhov teeb tsa. Kem F siv qhov txiaj ntsig no los suav qhov cuam tshuam cuam tshuam RATIO, thiab, thaum kawg, Kab G sib tw RATIO los ntawm analogRead tus nqi siab tshaj (1023) kom tau txais qhov kwv yees kwv yees tus nqi sib piv. 2 kab lus kawg muaj qhov txiaj ntsig tiag tiag los ntawm kev ua haujlwm ntawm qhov program demo nrog rau qhov sib txawv ntawm qhov kwv yees thiab qhov tseeb.
Tshooj yav dhau los hais txog peb txoj hauv kev kom tau txais cov txheej txheem sib piv suav nrog kev txuas ntxiv ntawm daim ntawv nthuav qhia no yog tias tus nqi tiv thaiv tau hloov pauv ntau dua lossis hloov pauv ntau ntxiv. Nws pom tias qhov sib txawv me me hauv tus tiv thaiv qhov tseem ceeb tsis cuam tshuam rau qhov txiaj ntsig kawg (uas yog qhov zoo txij li cov lus qhia tshwj xeeb ntawm tus tiv thaiv muab kev ua siab ntev, hais 5%, thiab tus tiv thaiv tsis tshua muaj sib npaug rau nws qhov txiaj ntsig tau teev tseg).
Kauj Ruam 4: Ua Tune
Txhawm rau piav qhia yuav ua li cas cov txheej txheem hloov pauv ntau yam tuaj yeem siv hauv daim ntawv thov, kev sib piv qhov kev qhia ua haujlwm los ntawm ntu "Txoj Kev Piav Qhia" tau hloov kho los ua qhov kev xaiv ua suab paj nruag rau lub program nkauj lub thawv. Cov ntawv thov hloov kho tshiab tau qhia saum toj no. Tsuas yog ntxiv rau kho vajtse yog passive piezo buzzer los ua suab paj nruag xaiv. Qhov kev hloov pauv yooj yim rau software yog ntxiv ntawm kev niaj hnub los ua suab, ib zaug pom, siv lub suab nrov thiab Arduino lub suab niaj hnub.
Cov kab lus luv luv uas muaj muaj nyob hauv cov ntawv header, Tunes.h, nrog rau kev txhais ntawm cov txheej txheem txhawb nqa tsim nyog. Txhua lub suab tau txhais los ua ib pawg ntawm cov cim cuam tshuam nrog cov qauv uas muaj qhov cim tseg zaus thiab sijhawm. Cov ntawv ceeb toom ntau zaus muaj nyob hauv cov ntawv cais lub npe, Pitches.h. Cov program thiab kab ntawv header muaj rau rub tawm ntawm qhov kawg ntawm ntu no. Tag nrho peb cov ntaub ntawv yuav tsum tau muab tso rau hauv tib phau ntawv.
Kev xaiv thiab kev txheeb xyuas tau raws li hauv qab no:
- "Tus neeg siv" teeb tsa cov hloov pauv hauv qhov teeb tsa cuam tshuam nrog lub suab xav tau
- txhua qhov phiaj xwm kev voj voog tus cim rau qhov tam sim no hloov pauv teeb tsa tau los ntawm analogRead
- Kauj ruam 2 tus cim kev teeb tsa tau muab piv rau txhua tus neeg sib piv hauv cov npe uas muaj
-
Yog tias muaj kev sib tw pom cov playTune niaj hnub hu nrog cov ntaub ntawv xav tau txhawm rau nkag mus rau cov npe sau nkauj
Siv lub suab Arduino ua haujlwm txhua daim ntawv tau ua los ntawm lub suab nrov
- Yog tias tsis pom qhov sib tw, tsis muaj kev nqis tes ua
- rov hais dua 1-5
DIP hloov chaw teeb tsa rau cov nkauj muaj nyob hauv cov lus hauv qab no qhov twg 1 txhais tau tias hloov pauv, 0 hloov tawm. Nco qab tias txoj hauv kev hloov pauv mus rau qhov chaw hloov pauv 1 nyob rau sab laug-txoj haujlwm feem ntau (ib qho cuam tshuam nrog 80K resistor).
Npe | Hloov 1 | Hloov 2 | Hloov 3 | Hloov 4 |
Danny Tub | 1 | 0 | 0 | 0 |
Me Xyooj | 0 | 1 | 0 | 0 |
Tsov Rog Tsaus Ntuj Hmo No | 1 | 1 | 0 | 0 |
Tsis Muaj Leej Twg Paub Qhov Teeb Meem | 0 | 0 | 1 | 0 |
Zoo Siab | 0 | 0 | 0 | 1 |
Chaw seem | 1 | 0 | 0 | 1 |
MockingBird Hill | 1 | 0 | 1 | 1 |
Lub suab zoo los ntawm piezo buzzer yeej tsis zoo tab sis nws tsawg kawg tuaj yeem lees paub. Qhov tseeb yog cov tones raug ntsuas, lawv nyob ze rau ntawm cov ntawv sau tseg zaus. Ib txoj hauv kev zoo siv hauv qhov haujlwm yog khaws cov ntaub ntawv qhib hauv ntu flash/program nco tsis siv ntu ntu cov ntaub ntawv nco los ntawm kev siv PROGMEM cov lus qhia. Cov ntaub ntawv ntu tuav cov haujlwm ua haujlwm hloov pauv thiab me dua, nyob ib puag ncig 512 bytes rau qee qhov ntawm ATtiny microcontrollers.
Pom zoo:
Cov Khoom Siv Teeb Meem Siv Chaw Taws Teeb Siv Arduino: 7 Kauj Ruam
Cov Khoom Siv Teeb Meem Siv Khoom Siv Hluav Taws Xob Siv Arduino: Tam sim no, Cov Tsim, Cov tsim tawm tau nyiam Arduino rau kev txhim kho sai ntawm cov qauv ntawm cov phiaj xwm. Arduino yog lub platform siv hluav taws xob qhib raws qhov yooj yim-rau-siv-kho vajtse thiab software. Arduino muaj zej zog cov neeg siv zoo heev. Hauv qhov no
Yuav Ua Li Cas Nyeem Ntau Qhov Analog Qhov Tseem Ceeb Siv Ib Tus Pin Pin: 6 Kauj Ruam (nrog Duab)
Yuav Ua Li Cas Nyeem Ntau Qhov Analog Tus Nqi Siv Ib Tus Pin Pin: Hauv qhov kev qhia no, kuv yuav qhia koj yuav ua li cas nyeem ntau yam sib piv qhov txiaj ntsig siv tsuas yog ib tus lej nkag nkag
Programmable True Bypass Guitar Effect Looper Station Siv Dip Hloov: 11 Kauj Ruam
Programmable True Bypass Guitar Effect Looper Station Siv Dip Switches: Kuv yog tus nyiam ntaus guitar thiab nyiam ua si. Feem ntau ntawm kuv cov phiaj xwm tshwm sim ib puag ncig cov khoom siv guitar. Kuv tsim kuv tus tswv amps thiab qee qhov ua tau zoo pedals yav dhau los kuv tau ua suab paj nruag me me thiab ntseeg kuv tus kheej tias kuv tsuas xav tau lub amp nrog re
Zoo Siab Hnub Yug Tune Siv Circuit Chaw Ua Si: 3 Kauj Ruam
Zoo Siab Hnub Yug Tune Siv Cov Chaw Ua Si Hauv Circuit: Nov yog yuav ua li cas Ua Kev Zoo Siab Hnub Yug Melody ntawm Adafruit's Arduino Compatible board Circuit Chaw Ua Si.Kuv xav tau qee yam me me los tso rau hauv ib lub thawv rau lub thawv hnub yug
Programming MSP430 DIP Siv Ez430: 4 Cov Kauj Ruam
Programming MSP430 DIP Siv Ez430: Thaum Kuv pom TI's ez430 USB programmer, nws zoo li yog ib txoj hauv kev yooj yim rau sawv thiab khiav nrog MCU. Kuv yuav yuam kev li cas, nws muaj ez hauv lub npe! Nws hloov tawm tias nws yog qhov yooj yim … feem ntau.Ez430 zoo heev yog tias koj xav tau