Cov txheej txheem:

Arduino Suab Sensor Tswb: 5 Kauj Ruam
Arduino Suab Sensor Tswb: 5 Kauj Ruam

Video: Arduino Suab Sensor Tswb: 5 Kauj Ruam

Video: Arduino Suab Sensor Tswb: 5 Kauj Ruam
Video: amplifier tpa3110 || 30 + 30 w amplified || board rip 🤣🤣#shorts 2024, Hlis ntuj nqeg
Anonim
Arduino Suab Sensor Tswb
Arduino Suab Sensor Tswb

Cov ntawv qhia no lub hom phiaj txhawm rau tsim lub tswb raws lub suab sensor los ntawm kev siv Arduino.

Kauj Ruam 1: Yuav Tsum Muaj Kev Koom Tes

1. Lub suab sensor

2. Ib qho LED

3. A 330-ohm resistor

4. Ib pawg Arduino

5. Ib pawg ntawm cov xov hlau

6. Lub computer

Ib qho ntxiv, nws xav tau kev nkag siab yooj yim ntawm Arduino code thiab nab hab sej

Kauj ruam 2: Tsim Circuit Court

Tsim Circuit Court
Tsim Circuit Court
Tsim Circuit Court
Tsim Circuit Court

Ib yam li thawj kab ntawv, lub suab sensor muaj plaub tus pin. VCC thiab GND yuav txuas rau 5V thiab GND ntawm Arduino. D0 xav tau xaim nrog txhua tus lej digital uas yog 7 hauv kuv lub Circuit Court ntawm Arduino board. Ntawd yog li cas lub suab sensor yuav tsum xaim.

Tom qab ntawd, Led yuav tsum tau txuas nrog ib yam nkaus. Sab luv yuav tsum txuas rau hauv av ntawm Mini breadboard. Qhov tseem ceeb tshaj yog 330-ohm resistor yuav tsum tau txuas ntawm lawv. Sab ntev yuav txuas mus rau lwm tus lej digital uas yog 13 hauv kuv qhov Circuit.

Kauj Ruam 3: Arduino Code

Tom qab teeb tsa kev teeb tsa, peb tuaj yeem siv Arduino code kom nws ua haujlwm.

Kauj ruam 4: Flask

Lub hwj
Lub hwj

Txhawm rau tswj lub ntsuas los ntawm lub raj mis, peb yuav xub sau lub hwj los ntawm nab nab. Peb thawj zaug yuav tsum paub dab tsi peb xav paub txhawm rau txhawm rau khaws hauv cov ntawv forms.py. Hauv qhov no, tsuas yog ib yam uas peb yuav tsum paub seb lub ntsuas hluav taws xob qhib lossis tawm.

Routes.py yuav tsum hloov cov ntaub ntawv yog tias peb hloov pauv lub xeev hloov pauv ntawm lub suab sensor. Ib qho ntxiv, peb yuav tsum siv pob pyserial txhawm rau sib txuas lus nrog Arduino txij li Arduino code tau suav ua ke hauv C code. Nws yuav sau tus nqi rau hauv Arduino txhawm rau qhib thiab kaw lub sensor.

Peb kuj xav tau ob daim ntawv HTML txhawm rau khiav lub vev xaib. Cov ntaub ntawv nkag mus yog cov ntawv koj yuav pom lub xeev ntawm lub sensor. Yog tias koj xav hloov lub xeev, nws yuav rov qab mus rau nplooj ntawv txheeb xyuas thiab qhov no yog nplooj ntawv koj tuaj yeem qhib thiab kaw lub sensor.

Txhua cov ntaub ntawv yuav tsum tau khaws tseg raws li cov duab los khiav lawv. Tsis tas li, koj yuav tsum siv pip nruab rau nruab lub raj mis, pyserial, hwj-wtf yog tias koj tsis muaj lawv. Nov yog cov qauv tsim nyog los khiav cov ntaub ntawv hauv qab no.

Kauj Ruam 5: Xeem

Tom qab txhua qib saum toj no tiav, koj yuav tsum muaj peev xwm khiav koj lub tswb tshiab tshiab. Txhawm rau ua qhov ntawd, koj yuav tsum tau khiav "nab nab iotapp.py".

Pom zoo: