Cov txheej txheem:

Qhov Kev Kawm MicroPython: Puas Yog Lub Hau Dej Nyob?: 8 Kauj Ruam (nrog Duab)
Qhov Kev Kawm MicroPython: Puas Yog Lub Hau Dej Nyob?: 8 Kauj Ruam (nrog Duab)

Video: Qhov Kev Kawm MicroPython: Puas Yog Lub Hau Dej Nyob?: 8 Kauj Ruam (nrog Duab)

Video: Qhov Kev Kawm MicroPython: Puas Yog Lub Hau Dej Nyob?: 8 Kauj Ruam (nrog Duab)
Video: qhov yuav kev los ntawm txoj kev kawm 2020 2024, Kaum ib hlis
Anonim
Qhov Kev Kawm MicroPython: Puas Yog Chav Dej Nyob?
Qhov Kev Kawm MicroPython: Puas Yog Chav Dej Nyob?

Peb lub chaw haujlwm yog pawg ua haujlwm loj uas muaj chaw tso dej tsawg. "Kuv" feem ntau pom tias kuv tsis muaj chav mus rau chav dej, yog li kuv yuav tsum tau tos ntev li ntawd kuv thiaj txaj muag.

Qhov kev sim siv MakePython ESP8266 txhawm rau teeb tsa lub server nrhiav kom pom tias txhua tus tuaj yeem nkag mus tau los ntawm tus IP chaw nyob txhawm rau txheeb xyuas lub rooj zaum hauv chav dej, zam kev tos tos tos tos.

Kauj Ruam 1: Cov khoom siv

Khoom siv
Khoom siv

kho vajtse:

  • MakePython ESP8266 Cov
  • Infrared sensor
  • Cov qhob cij
  • Dhia kab
  • USB cable
  • Scotch daim kab xev

MakePython ESP8266 yog ESP8266 pawg thawj coj nrog kev sib xyaw SSD1306 OLED zaub, koj tuaj yeem tau txais nws los ntawm qhov txuas no:

Infrared sensor: Thaum lub ntsuas hluav taws xob pom lub teeb liab ua ntej, lub teeb ntsuab qhia ntawm lub rooj tsav xwm hluav taws xob teeb tsa qib, thaum OUT chaw nres nkoj txuas ntxiv rau cov teeb liab qis. Kev txheeb xyuas qhov nrug ntawm tus qauv yog 2 ~ 30cm, thiab Lub Ntsej Muag Pom Pom yog 35 °. Qhov ntsuas pom tau tuaj yeem hloov kho los ntawm lub zog ntsuas. thaum lub potentiometer raug kho raws lub moos, qhov kev ntsuas pom tau nce ntxiv; Counterclockwise potentiometer, nrhiav kom pom qhov nrug tau raug txo;

software:

uPyCraft V 1.1

Nyem qhov txuas no mus rub uPyCraft IDE rau Windows:

Kauj ruam 2: Kev thaiv kab

Thaiv
Thaiv
  • VCC tus pin ntawm cov duab hluav taws xob txuas nrog 3V3 ntawm MakePython ESP8266, GND txuas nrog GND, thiab OUT txuas nrog IO14 ntawm pawg thawj coj.
  • Txuas MakePython ESP8266 rau PC siv USB cable, Qhib tus thawj tswj ntaus ntawv (Tsuas yog tshawb rau "ntaus ntawv" hauv Windows lub thawv tshawb nrhiav). Thaum nthuav dav, ntu chaw nres nkoj yuav tsum tso saib qee yam zoo li saum toj no. Sau ntawv ntawm tus naj npawb chaw nres nkoj, xws li COM18 hauv kuv kis. Yog tias tsis muaj chaw nres nkoj tshwm, sim rub lub USB tsav:

Kauj Ruam 3: UPyCraft Cov Lus Qhia rau Kev Siv

UPyCraft Cov Lus Qhia rau Kev Siv
UPyCraft Cov Lus Qhia rau Kev Siv

Rub tawm Qhov Pib MicroPython ESP8266 cov ntaub ntawv, uas tau piav qhia ntxaws hauv MicroPython Cov Cuab Yeej Tsim Kho ntu ntawm cov ntawv, uas yuav pab koj rub tawm thiab teeb tsa uPyCraft IDE thiab siv nws. Nws kuj suav nrog kev qhia rau MakePython ESP8266.

Lossis koj tuaj yeem tau txais cov ntawv los ntawm qhov txuas no:

Kauj ruam 4: Txoj Cai Rub Tawm

Txoj Cai Download
Txoj Cai Download

Rub tawm cov ntawv main.py thiab qhib nws, koj yuav tsum hloov kho cov ntsiab lus hauv qab no:

  • SSID: yuav tsum hloov pauv mus rau koj lub npe network hauv zos
  • PASSWORD: yuav tsum hloov pauv mus rau koj tus lej network network
  • Yog tias OUT Pin ntawm tus qauv duab hluav taws xob tau txais kev hloov pauv los ntawm MakePython ESP8266, hloov tus lej hauv tus Pin () rau Tus Pin koj siv los txais nws.

Thaum koj ua tiav, nyem nyem Txuag thiab DownAndRun. "download tau ok" yuav muab tso tawm thaum rub tawm tau zoo, koj tuaj yeem pom tus IP chaw nyob (kuv li: 192.168.1.116).

Kauj ruam 5: Kev teeb tsa

Kev teeb tsa
Kev teeb tsa
Kev teeb tsa
Kev teeb tsa

Tso lub infrared module nyob ib sab ntawm lub qhov rooj kom pom tau yooj yim ntawm tib neeg thiab ruaj ntseg nws nrog muag muag. Thaum ib tus neeg siv chav dej, tus qauv xa cov ntawv xeem mus rau tus neeg rau zaub mov ntawm WiFi, yog li peb tuaj yeem nkag mus rau tus neeg rau zaub mov ntawm tus IP chaw nyob txhawm rau txheeb xyuas yog tias chav dej tso quav, tsis txhob tos ntawm chav dej.

Kauj ruam 6: Qhib Browser

Qhib Browser
Qhib Browser

Qhib qhov browser ntawm koj lub PC, ntaus tus IP chaw nyob uas koj nyuam qhuav tau txais (192.168.1.116), thiab nyem Enter kom paub meej.

Kauj Ruam 7: Xeem

Kev Xeem
Kev Xeem
Kev Xeem
Kev Xeem

Nyem rau "tshawb nrhiav" khawm, koj tuaj yeem tshawb xyuas seb lub chav dej puas nyob hauv. Thaum siv chav dej tso quav, nplooj ntawv yuav qhia tias nws nyob hauv, tsis li ntawd, nws yuav qhia tias tsis muaj leej twg, yog li koj tuaj yeem yooj yim mus rau chav dej yam tsis tau tos sab nraud.

Kauj ruam 8: Tswv yim

Lub tswv yim
Lub tswv yim

Tom qab qhov kev sim, kuv tau muaj qee lub tswv yim, hauv qee lub khw yuav khoom, muaj chav dej nyob hauv txhua chav, tab sis feem ntau muaj kab ntev rau poj niam cov chav dej rau cov poj niam cov khaub ncaws, thaum cov txiv neej cov chav dej tsis muaj dab tsi. Ua kom siv Makepython nrog Lora txuas los txhawm rau txheeb xyuas lub xov tooj ntawm tes ntawm lub qhov rooj ntawm txhua chav dej, txiav txim seb muaj pes tsawg tus neeg, thiab ua rau muaj kev sib txawv raws li xav tau; Kuv yuav sim nws tom qab, yog tias koj xav tau, ua raws lossis koom nrog kuv.

Pom zoo: