Cov txheej txheem:
- Kauj Ruam 1: Muab Lub Hwj Chim Rau Koj Daim Npav Breadboard
- Kauj Ruam 2: Ua Kom Koj Lub Breadboard
- Kauj Ruam 3: Ntxig Koj Lub Pob
- Kauj Ruam 4: Av Koj Lub Pob
- Kauj Ruam 5: Txuas Koj Lub Pob
- Kauj Ruam 6: Ntxig Koj Buzzer
- Kauj Ruam 7: Qhib Buzzer
- Kauj Ruam 8: Fais Fab Buzzer
- Kauj Ruam 9: Sau Koj Li Cai
- Kauj Ruam 10: Siv Serial Monitor los Nyeem Koj Cov Lus
- Kauj Ruam 11: Xav Tau Ntau Txoj Haujlwm Zoo Li No?
Video: Arduino Morse Code Transmitter: 11 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:27
Hauv cov lus qhia no, koj yuav siv Arduino Uno los tsim Morse Code tus xa xov, thiab siv lub ntsuas saib xyuas los nyeem cov lus koj tau kis.
Qhov koj yuav xav tau:
Arduino Ib
Cov qhob cij
Buzzer
Nyees khawm
Jumper xov hlau
Kauj Ruam 1: Muab Lub Hwj Chim Rau Koj Daim Npav Breadboard
Txuas lub jumper hlau los ntawm 5V tus pin ntawm koj Arduino Uno rau kab zoo ntawm koj lub khob cij.
Kauj Ruam 2: Ua Kom Koj Lub Breadboard
Tam sim no txuas cov xaim los ntawm ib qho ntawm GND pins ntawm Arduino mus rau kab tsis zoo ntawm koj lub khob cij.
Kauj Ruam 3: Ntxig Koj Lub Pob
Ntxig koj lub pob. Nco ntsoov tias ob ntawm nws ob txhais ceg nyob ntawm txhua sab ntawm cov channel nqes nruab nrab ntawm koj lub khob cij, thiab ob txhais ceg tau tso khov kho. Nws yog ib qho yooj yim kom khoov lawv thaum koj nias nyuaj, yog li saib xyuas thaum koj thawb lub pob.
Kauj Ruam 4: Av Koj Lub Pob
Txuas lub pob mus rau hauv av los ntawm kev tso ib qho kawg rau hauv kab ib yam li cov ceg saum toj ntawm koj lub pob, thiab lwm qhov kawg rau hauv kab tsis zoo uas koj yav dhau los txuas rau hauv av.
Kauj Ruam 5: Txuas Koj Lub Pob
Kaw lub khawm khawm thiab tso cai rau Arduino nyeem nws cov lus nkag los ntawm kev txuas ib lub xov hlau los ntawm kab ib yam li hauv qab khawm khawm, thiab tus lej 7 ntawm Arduino.
Kauj Ruam 6: Ntxig Koj Buzzer
Ntxig koj lub suab nrov kom lub cim "+" nyob rau sab saum toj, lossis txhais ceg ntev me ntsis, nyob ntawm ib sab ntawm lub khob cij raws li koj lub xaim txuas rau 5V.
Kauj Ruam 7: Qhib Buzzer
Txuas lub pob rau hauv av nrog xaim los ntawm tib kab raws li nws luv luv ceg mus rau txoj kab tsis zoo ntawm lub khob cij uas koj tau txuas yav dhau los rau GND.
Kauj Ruam 8: Fais Fab Buzzer
Muab lub zog rau lub suab nrov thiab tso cai rau Arduino los tswj nws nrog xaim los ntawm kab ib yam li nws cov ceg ntev dua rau tus pin 8 ntawm Arduino.
Kauj Ruam 9: Sau Koj Li Cai
Luam thiab paste peb cov cai, lossis rub tawm cov ntawv txuas.
Zoo li txoj hlua Morse = {".-", "-…", "-.-.", "-..", ".", "..-", "-.", "…. ",".. ",".--- "," -.- ",".-.. ","-","-. "," --- ",".--. ", "--.-", ".-.", "…", "-", "..-", "…-", ".--", "-..-", "-.--" ","-.. "," E "};
Cov tsiaj ntawv zoo li qub = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', ' x ',' y ', 'z', 'E'}; unsigned ntev push_length, start_push, end_push; // lub sij hawm uas khawm twg yog nias int khawm = 7; // input pin rau laub khawm int buzzer = 8; // outpu tus pin rau LED hlua txoj cai = ""; // txoj hlua uas ib tus tsiaj ntawv khaws cia
void teeb tsa () {
Serial.begin (9600); pinMode (khawm, INPUT_PULLUP); // sab hauv pullup resistor tau siv los ua kom yooj yim ntawm Circuit pinMode (buzzer, OUTPUT); Serial.println ("Pib koj cov lus!"); }
void lub voj ()
{MorseTransmission: thaum (digitalRead (khawm) == HIGH) {} start_push = millis (); // sijhawm ntawm lub pob nyem xov tooj cua (buzzer, 150); thaum (digitalRead (khawm) == LOW) {} end_push = millis (); // sijhawm ntawm khawm tso tawm noTone (buzzer); push_length = end_push - pib_push; // lub sij hawm rau lub khawm twg yog nias yog (push_length> 50) {// rau tus account rau hloov debouncing code += dot_or_dash (push_length); // muaj nuj nqi los nyeem dot lossis dash} thaum ((millis () - end_push) <500) // yog lub sijhawm nruab nrab ntawm lub pob nyem ntau dua 0.5sec, hla lub voj thiab mus rau cov ntawv tom ntej {yog (digitalRead (khawm) == LOW) {tau txais MorseTransmission; }} Morse_translation (chaws); // muaj nuj nqi rau decipher code rau hauv niam ntawv}
char dot_or_dash (ntab ntev)
{yog (ntev 50) {rov qab '.'; // yog tias khawm nias tsawg dua 0.6sec, nws yog tus dot} ntxiv yog (ntev> 600) {rov qab '-'; // yog tias khawm nias ntau dua 0.6sec, nws yog qhov nrawm}}
tsis muaj dab tsi Morse_translation (String morsecode)
{int kuv = 0; yog (code == ".-.-.-") {Serial.print ("."); // rau kev tawg} lwm qhov {thaum (Morse ! = "E") // lub voj rau kev sib piv cov lej nkag nrog cov tsiaj ntawv array {yog (Morse == morsecode) {Serial.print (Alphabet ); tawg; } kuv ++; } yog (Morse == "E") {Serial.println ("Yuam kev!"); // yog tias cov lej nkag tsis zoo ib yam ntawv, yuam kev}} code = ""; // rov pib dua txoj cai rau txoj hlua khoob}
Kauj Ruam 10: Siv Serial Monitor los Nyeem Koj Cov Lus
Qhib cov ntawv saib xyuas kom pom koj cov lus thaum koj nias lub pob kom tsim Morse Code. Siv cov lus qhia saum toj no los ua ntu zus koj cov ntawv teev thiab cov cim kom tsim nyog!
Kauj Ruam 11: Xav Tau Ntau Txoj Haujlwm Zoo Li No?
Tau txais ib feem rau 2-3 qhov haujlwm hauv ib hlis thiab cov lus qhia thiab yees duab los tsim lawv nrog MakeCrate!
Pom zoo:
Morse Code Chaw Nres Tsheb: 3 Kauj Ruam
Morse Code Chaw Nres Tsheb: Dit-dit-dah-dah! Kawm Morse Code nrog qhov yooj yim Arduino Uno project Qhov no yooj yim Arduino project yog Morse Code chaw nres tsheb. Morse Code yog txoj hauv kev sib txuas lus uas cim cov cim ua ntu ntu thiab kab zauv. Qhov kev siv hluav taws xob no siv piezo buzzer los
LabDroid: Morse Code Encoder/Decoder: 4 Kauj Ruam
LabDroid: Morse Code Encoder/Decoder: Nco tseg: Cov lus qhia no tsis tuaj yeem lees paub 1: 1 hauv LabDroid tshiab tshaj plaws. Kuv yuav hloov kho sai sai no txoj haujlwm no yuav qhia koj tias koj tuaj yeem ua dab tsi nrog LabDroid. Txij li Lub Ntiaj Teb Nyob Zoo ib txwm ua los ntawm cov ntawv, lub teeb lossis lub suab, Kuv xav rau LabDr
Arduino Morse Code Writer: 7 Kauj Ruam (nrog Duab)
Arduino Morse Code Writer: Kuv tau ua tus neeg hlau uas tuaj yeem hloov cov ntawv muab rau hauv Morse code thiab tom qab ntawd sau nws !! Nws tau ua los ntawm cov duab los qhia thiab Lego thiab rau cov khoom siv hluav taws xob Kuv siv Arduino thiab tsuas yog ob lub cav
USB Arduino Morse Code Key: 6 Kauj Ruam
USB Arduino Morse Code Key: Puas tau xav ntaus hauv lub khoos phis tawj nrog tus lej yuam sij yuam kev lossis kawm/qhia tus lej lej? Koj nyob ntawm nplooj ntawv raug! Rau kuv lwm cov haujlwm, txheeb xyuas kuv lub vev xaib calvin.sh
Morse Code rau Text Siv Arduino: 5 Kauj Ruam
Morse Code rau Cov Ntawv Siv Arduino: IDEA Nqe lus piav qhia Peb txhua tus sib tham nrog ib leeg dhau los ntawm peb lub ntuj Sensors (tus nplaig, Piav tes piav taw … lwm yam). Qhov Zoo Tshaj Plaws pib thaum koj xav qhia cov ntaub ntawv tsis pub lwm tus paub rau lwm tus. Cov lus nug yog yuav ua li cas? Yog li cov lus teb nyob hauv qhov koj xa kuv li cas