Cov txheej txheem:

Ib Tus Kws Sau Ntawv Tseem Ceeb: 4 Kauj Ruam
Ib Tus Kws Sau Ntawv Tseem Ceeb: 4 Kauj Ruam

Video: Ib Tus Kws Sau Ntawv Tseem Ceeb: 4 Kauj Ruam

Video: Ib Tus Kws Sau Ntawv Tseem Ceeb: 4 Kauj Ruam
Video: QHIA QHOV TSEEB - KUB VAJ LOOG TSUA NEW MUSIC VIDEO 2022 2024, Hlis ntuj nqeg
Anonim
Ib Tus Kws Sau Ntawv
Ib Tus Kws Sau Ntawv

Koj puas nco Stephen Hawking? Nws yog tus xibfwb ntawm Cambridge thiab tus kws ua lej uas muaj npe nrov hauv lub rooj zaum muaj lub computer tsim lub suab. Nws raug mob los ntawm Motor Neurone Disease thiab mus txog qhov kawg ntawm nws lub neej, tom qab nws plam nws qhov kev hais lus, nws muaj peev xwm sib txuas lus los ntawm kev hais lus-tsim cov cuab yeej-pib los ntawm kev siv lub tes tuav hloov, thiab thaum kawg los ntawm kev siv ib leeg leeg nqaij.

Kuv xav tias kuv yuav tsum mus ntawm kev tsim ib qho kev hloov pauv hloov sau ntawv ntaus ntawv. Tsuas yog ib qho hloov pauv - ON lossis OFF. Koj tuaj yeem ua dab tsi nrog qhov ntawd?

Peb yuav tsum xav txog lub sijhawm. Yog tias koj kaw qhov hloov pauv thiab tom qab ntawd qhib nws qee lub sijhawm tom qab koj muaj kev tswj hwm ntawm lwm qhov sib txawv. Peb tuaj yeem siv sijhawm ncua sijhawm nruab nrab ntawm kev kaw thiab qhib kev hloov pauv los tsim cov tswv yim sib txawv thiab tig lawv mus rau hauv cov ntawv lossis kab ntawv. Kuv xav kom muaj peev xwm sau "HELLO, NTIAJ TEB!" thiab xa nws mus rau Serial Monitor - txhua yam los ntawm ib lub pob.

Muaj lub millisecond timer khiav hauv koj Arduino. Nws nyem los ntawm 1 txhua 0.001 vib nas this. Koj tuaj yeem nyeem nws tus nqi nrog nqe lus

int t = millis ();

// Ua ib yam dab tsi

int tt = millis ();

int timeDiff = tt - t;

Khoom siv

Kuv yuav siv cov khoom uas feem ntau Arduino cov neeg siv yuav twb muaj thiab pheej yig heev los yuav:

  • Arduino UAS
  • 16 x 2 LCD
  • 220 Ohm thiab 10K Ohm resistors
  • 10K Ohm potentiometer
  • Khawm hloov
  • Breadboard los yog stripboard
  • Txuas xov hlau

Kauj Ruam 1: Txoj Kev

Txoj Kev
Txoj Kev

Ntawm no peb muaj daim phiaj uas muaj txhua tus tsiaj ntawv, tus lej 0 txog 9 thiab tuaj sau cov cim cim cim tseg. Tsab ntawv "A" nyob hauv kab 1 thiab kab lus 2. Tus lej "9" nyob hauv kab 7 thiab kab lus 1. (Koj yuav xav luam lub vijtsam no kom muaj nyob rau ntawm koj xub ntiag thaum khiav tsab ntawv tom qab.)

Cov lus qhia qhia koj yuav siv qhov hloov pauv li cas. Yog tias koj tuav lub pob khawm tus nqi kab yuav maj mam suav los ntawm xoom. Nqa koj tus ntiv tes los ntawm lub pob thaum tus nqi kab yog 1.

Tuav lub pob dua thiab tus lej kab yuav pib suav los ntawm xoom. Nqa koj tus ntiv tes thaum nws pom 2 thiab koj tau xaiv "A" los ntawm kab: 1 thiab kab lus: 2.

Tam sim no peb yuav tsum hloov qhov "A" rau cov lus ntawm kab hauv qab. Tuav lub pob thiab tsa koj tus ntiv tes ntawm qhov ua 1 - ntxiv tus cim.

Txhawm rau ntxig "9" peb xaiv kab 9 thiab kab 1 tom qab ntawd ntxiv nws nrog ua 1.

Nqe 2 tshem tag nrho cov lus.

Kev Ua 3 Dumps ib tus ua cim tsis raug yam tsis ntxiv nws rau kab lus. (Mis-xaiv yog ib txwm!)

Nqis 4 xa cov lus los ntawm lub vijtsam LCD mus rau Serial Monitor.

Kauj Ruam 2: Txuas Cov Khoom

Txuas Yam Ntxiv
Txuas Yam Ntxiv

Yog tias koj muaj Liquid Crystal Display screen koj yuav zaum siv nws txhua lub sijhawm. Nws yog lub tswv yim zoo los tsim lub rooj sib txuas me me tuav lub LCD, lub zog loj (rau kev kho lub teeb ci) thiab tiv thaiv tiv thaiv nrog ib lub xov hlau rau 5 volts thiab GND. Txoj kev taug raug txiav ntawm qhov rov qab ntawm lub rooj tsavxwm, hauv qab 220 Ohm resistor. Kuv tom qab ntxiv cov khoom tso rau hauv pawg thawj coj rau 5V thiab GND vim tias Arduino tsuas muaj ib qho 5V nkaus xwb. Qhov no txuag lub sijhawm, xov hlau thiab ntsuas lwm lub sijhawm koj xav tau LCD hauv lwm qhov haujlwm. "Txoj hauv kev" nyob ntawm no:

www.arduino.cc/en/Tutorial/HelloWorld

Lub khawm tau txuas rau tus pin 8 nrog 10K rub tawm tus tiv thaiv thiab rau GND.

Kauj ruam 3: Nov Yog Kuv Teeb

Nov Yog Kuv Teeb
Nov Yog Kuv Teeb

Ntawm nplooj ntawv tom ntej yog qhov txuas rau Tinkercad version los sim.

Siv tus nas taw tes thiab khawm kom kaw thiab qhib lub pob nyem nyob hauv nruab nrab ntawm daim duab. Koj yuav tsum qhib lub qhov rai qhov chaws thiab tom qab ntawd Serial monitor nyob hauv qab ntawm nplooj ntawv kom muaj cov lus xa los ntawm lub vijtsam LCD mus rau Serial monitor. Lub pob "Pib Simulation" pib ua txoj cai.

Tej zaum koj yuav pom tias nws nyuaj heev thaum xub thawj. Tsuas yog xav tias yuav ua rau nws ntxhov siab npaum li cas yog tias qhov no yog koj li kev sib txuas lus nkaus xwb.

Kauj ruam 4: Tinkercad Version

Tinkercad Version
Tinkercad Version

Kuv tau teeb tsa Tinkercad version ntawm no tab sis muaj ntau qhov tsis tuaj yeem thiab teeb meem sijhawm los muab kev paub zoo. Lub qhov rais kuj tseem me dhau los tso cai rau hauv Circuit Court, Code thiab qhov tseem ceeb Serial Monitor window kom tso tawm kom raug.

www.tinkercad.com/things/daSgRAOl0g1-oneke…

Nov yog qhov txuas rau Tinkercad thawj qhov uas yog qhov zoo me ntsis loj dua thiab yooj yim dua kom muaj lub qhov rai qhib thaum lub sijhawm sim kom koj tuaj yeem pom Serial Monitor. Lub sijhawm tseem ceeb ua haujlwm kom raug.

Kuv vam tias koj tau txaus siab rau Cov Lus Qhia no thiab kawm qee yam ntawm txoj kev.

Kuv nkag mus rau Cov Lus Qhia hauv Arduino Contest thiab yuav zoo siab rau koj qhov kev pov npav yog tias koj nyiam nws.

Pom zoo: