Cov txheej txheem:

IoT Analog Input - Pib Nrog IoT: 8 Cov Kauj Ruam
IoT Analog Input - Pib Nrog IoT: 8 Cov Kauj Ruam

Video: IoT Analog Input - Pib Nrog IoT: 8 Cov Kauj Ruam

Video: IoT Analog Input - Pib Nrog IoT: 8 Cov Kauj Ruam
Video: Как отслеживать и контролировать ESP32 из любой точки мира с помощью RemoteXY IoT Cloud 2024, Kaum ib hlis
Anonim
Image
Image
Npaj Koj Pawg Thawj Coj Npaj rau AppShed IoT
Npaj Koj Pawg Thawj Coj Npaj rau AppShed IoT

Los ntawm appshedAppShedFollow Ntau los ntawm tus sau:

Npaj Koj Pawg Thawj Coj Npaj rau AppShed IoT
Npaj Koj Pawg Thawj Coj Npaj rau AppShed IoT
JavaScript thiab App Builder: Zaj Lus Qhia 1
JavaScript thiab App Builder: Zaj Lus Qhia 1
JavaScript thiab App Builder: Zaj Lus Qhia 1
JavaScript thiab App Builder: Zaj Lus Qhia 1
Ua Mobile Game Tsis Coding
Ua Mobile Game Tsis Coding
Ua Mobile Game Tsis Coding
Ua Mobile Game Tsis Coding

Txog: Appshed yog lub hauv paus kev kawm uas cov tub ntxhais kawm thiab cov kws qhia ntawv tuaj yeem kawm App Building, Game Making thiab IoT/Robotics. Xav paub ntau ntxiv txog appshed »

Nkag siab Cov Lus Qhia Analog yog ib feem tseem ceeb ntawm kev nkag siab tias yam khoom nyob ib puag ncig peb ua haujlwm li cas, feem ntau yog tias tsis yog txhua lub ntsuas hluav taws xob yog cov ntsuas sib piv (qee zaum cov ntsuas no tau hloov pauv mus rau digital). Tsis zoo li cov tswv yim digital uas tuaj yeem tsuas yog qhib lossis kaw, cov tswv yim sib piv tuaj yeem yog txhua yam los ntawm 0 txog 1024 (nyob ntawm koj lub microcontroller) uas tso cai rau peb nyeem ntau cov ntaub ntawv los ntawm cov ntsuas.

Yog li hauv txoj haujlwm no, peb tab tom saib yuav ua li cas nyeem cov txiaj ntsig sib piv nrog IoT ntaus ntawv thiab xa cov ntaub ntawv rov qab rau peb lub xov tooj.

Kauj ruam 1: Analog Vs Digital

Analog Vs Digital
Analog Vs Digital
Analog Vs Digital
Analog Vs Digital
Analog Vs Digital
Analog Vs Digital

Analog thiab digital ob qho tib si sib txawv tab sis ob leeg muaj lawv tus kheej siv. Piv txwv li, txhua lub nyees khawm yog cov tswv yim digital, qhov no vim tias cov tswv yim digital tuaj yeem tsuas yog 0 lossis 1, qhib lossis tawm, thiab raws li peb paub cov nyees khawm tuaj yeem qhib lossis kaw, rov 0 lossis 1.

Txawm li cas los xij, qee qhov kev nkag mus yog qhov nyuaj me ntsis ntau dua li tsuas yog 0 lossis 1, piv txwv li, cov cim xa rov qab ntau yam txiaj ntsig uas yuav ploj yog tias koj nyeem lawv los ntawm kev siv digital tab sis cov tswv yim analog tso cai rau koj nyeem qhov tseem ceeb ntawm 0 mus rau 1024. Qhov no tso cai rau peb kom tau txais txiaj ntsig ntau ntxiv.

Ib qho piv txwv ntawm qhov no tuaj yeem pom hauv cov duab muab, thawj daim duab qhia pom cov tswv yim digital, tus nqi tsuas yog 0 lossis 1 qhov twg tus nqi thib ob qhia txog kev nkag mus sib piv thiab raws li koj tuaj yeem pom nws muaj qhov nkhaus zoo ua nrog qhov tseem ceeb ntawm 0i1024 ib.

Kauj Ruam 2: Txoj Kev Npaj thiab Yam Peb Xav Tau

Txoj Kev Npaj thiab Yam Peb Xav Tau
Txoj Kev Npaj thiab Yam Peb Xav Tau

Yog li ntawm qhov kev txiav txim kom nyeem tau cov txiaj ntsig zoo sib xws, peb xav tau qee yam kev ntsuas uas ua rau lawv tawm. Yog li peb tab tom yuav siv lub hwj chim ntsuas hluav taws xob uas yog qhov sib txawv tiv taus qhov no peb tuaj yeem pom qhov txiaj ntsig hloov pauv thaum peb txav lub pob qhov rooj.

Peb tseem yuav xav tau los ua ib qho app rau peb lub xov tooj kom tau txais qhov txiaj ntsig los ntawm IoT pawg thawj coj, txawm li cas los xij, qhov no ua tiav tau yooj yim heev nrog AppSheds app tsim.

Yog li kom tau txais qhov no thiab ua haujlwm peb yuav xav tau cov hauv qab no:

  • IoT Board (Peb tab tom siv NodeMCU tab sis qhov no tau sim thiab ua haujlwm nrog Sparkfun 8266 tshaj plaws, Adafruit plaub thiab cov khoom siv ESP 8266.
  • Lub hwj chim me me (txhua yam los ntawm 50k txog 500k yuav ua haujlwm zoo)
  • Cov qhob cij
  • Qee tus txiv neej rau txiv neej dhia

Txoj kev npaj yog xaim txhua yam ntawm daim ntawv tais, xa cov cai rau Node thiab tom qab ntawd txuas nws rau peb app uas peb yuav ua. Cia peb pib

Kauj Ruam 3: Txhim Kho Lub Tsev Qiv Ntawv

txhawm rau upload peb cov cai peb yuav siv qhov nrov heev Arduino IDE uas tuaj yeem rub tawm ntawm no. Tam sim no vim tias peb tab tom yuav siv lub vev xaib AppShed los tswj thiab hloov kho txoj kev uas pawg thawj coj saib xyuas ua haujlwm peb tsis tas yuav tsom mus rau tus lej tseeb nkag mus rau hauv pawg thawj coj. Cov cai peb tab tom rub tawm yog AppShed tus thawj coj kos duab uas tso cai rau lub vev xaib los tswj hwm txhua tus pins ntawm lub rooj tsavxwm.

Tam sim no kom tuaj yeem xa cov cai rau peb pawg thawj coj los ntawm Arduino IDE peb yuav tsum teeb tsa nws lub tsev qiv ntawv uas tso cai rau IDE tham nrog peb pawg thawj coj tshwj xeeb. Qhov no yog ua raws li hauv qab no:

  • Tua tawm Arduino IDE
  • Nkag mus rau Cov Ntaub Ntawv thiab nyem Nyiam
  • Mus rau hauv qab, koj yuav tsum pom "tus thawj tswj hwm ntxiv URLs" ua raws los ntawm qhov chaw khoob
  • Luam thiab muab qhov no tso rau hauv qhov chaw khoob

Tam sim no peb yuav tsum teeb tsa cov laug cam hauv qab tus thawj tswj hwm.

  • Nkag mus rau Cov Cuab Yeej, tom qab ntawd Pawg Thawj Coj thiab tom qab ntawd nyem rau ntawm Pawg Thawj Coj
  • Tam sim no hauv kab ntawv tshawb nrhiav ESP8266
  • Nyem rau thawj qhov kev xaiv thiab nyem Nruab

Tam sim no peb pawg thawj coj muaj peev xwm sib tham nrog Arduino IDE

Kauj Ruam 4: Xa Cov Cai

Xa cov Code
Xa cov Code

Yog li ntawm qhov no, peb tau rub cov tsev qiv ntawv uas xav tau los pab Arduino IDE sib tham nrog peb pawg IoT thiab peb tau rub tawm cov tsev qiv ntawv uas tso cai rau AppShed master sketch los ua haujlwm. Tam sim no, txhua yam peb yuav tsum tau ua yog hloov lub npe thiab tus password ntawm koj lub cuab yeej IoT hauv tus lej yog tias koj tsis ua qhov no koj li IoT li wifi npe yuav yog "Your_device_name_here".

Txhawm rau ua qhov no peb xav tau cov hauv qab no:

  • Txuas koj lub rooj tsav xwm IoT rau hauv koj lub computer
  • Rub tawm thiab qhib Appshed master sketch (uas tuaj yeem pom ntawm no)
  • Nkag mus rau cov cuab yeej thiab nyem rau ntawm lub nkoj
  • Scroll cia kom txog thaum koj pom koj lub rooj tsavxwm, tom qab ntawd nyem rau nws (Kuv siv NodeMCU yog li kuv yuav nyem rau ntawm NodeMCU)
  • Tam sim no rov qab mus rau cov cuab yeej thiab nyem rau ntawm qhov chaw nres nkoj, ntawm no koj yuav tsum pom koj lub rooj tsavxwm (yuav tsum zoo li qhov no "com 9" yog tias koj nyob ntawm windows thiab "/dev/cu.wchusbserial1410 'rau mac)
  • Nyem rau sab sab xub xub kom rub thiab tos thaum nws ua li ntawd.

Yog tias koj tau txais cov lus tom qab li 2 - 3 feeb hais tias ua tiav kev rub tawm ces txhua yam ua haujlwm tau zoo! Txhawm rau txheeb xyuas ob zaug tias peb pawg thawj coj ua haujlwm peb tseem tuaj yeem mus rau peb lub WiFi teeb tsa thiab nrhiav lub npe uas peb tau muab rau pawg thawj coj ua ntej yog tias nws nyob ntawd nws ua haujlwm.

Kauj Ruam 5: Teeb Peb App

Teem Peb App
Teem Peb App
Teem Peb App
Teem Peb App

Yog li ua ntej peb tuaj yeem tsim lub app peb yuav tsum qhia lub vev xaib AppShed uas tus pin ntawm lub rooj tsavxwm peb yuav tau nyeem los ntawm. Txhawm rau ua qhov no peb mus rau www.appshed.com thiab nkag mus, ib zaug nkag mus koj yuav tsum pom nplooj ntawv hu ua IoT builder peb yuav xav tau nyem rau ntawm qhov ntawd.

Ib zaug sab hauv IoT tus tsim, peb pib los ntawm kev tsim lub rooj tsav xwm tshiab thiab npe nws "IoT Input" ua raws li txuag. Txog tam sim no peb tau nthuav tawm nrog lub microcontroller nrog ntau tus pin nyob ib puag ncig nws, cov pins no yog cov sawv cev ntawm tus pin ntawm koj li IoT board. Yog li piv txwv, yog tias peb teeb tus pin 1 ntawm lub rooj tsavxwm no rau HIGH, tus pin 1 ntawm koj lub rooj tsavxwm tseem yuav HIGH.

Tam sim no hauv qab Analog Inputs, koj yuav tsum pom qhov kev xaiv rau potentiometer, peb yuav nyem rau qhov ntawd thiab tom qab ntawd nyem rau tus pin 40 txhawm rau txuas lub lauj kaub rau tus pin 40. Pin 40 sawv cev rau tus pin A0.

Nrog qhov txuas peb tuaj yeem nyem txuag thiab lub taub hau mus rau app tsim sab ntawm yam

Kauj ruam 6: Ua App

Ua App
Ua App
Ua App
Ua App
Ua App
Ua App

Ntawm app lub tsev nplooj ntawv, thawj qhov koj yuav tsum tau nthuav tawm nrog yog lub xov tooj simulated, thawj qhov peb yuav xav ua yog nyem qhov me me ntxiv rau lub cim nyob hauv qab ntawm lub vijtsam kom pib lub app tshiab.

Thaum lub app tshiab tau rub peb yuav txuas lub rooj tsavxwm peb nyuam qhuav ua hauv IoT tus tsim, peb ua qhov no los ntawm txhaj rau ntawm cov laug cam thiab tom qab ntawd nyem rau ntawm lub rooj tsavxwm peb nyuam qhuav ua. Nrog qhov tam sim no txuas nrog peb tuaj yeem nkag mus rau cov ntawv foos thiab nyem rau ntawm lub npov nkag. Peb tab tom yuav muab lub thawv nkag lub npe "IoT Input" thiab peb yuav tsum nco ntsoov muab nws lub npe sib txawv raws li peb tau muab lub hwj chim hauv IoT tus tsim kom paub tseeb tias koj muab "lauj kaub" hauv qhov sib txawv lub npe teb raws li qhov no yuav txuas IoT board rau lub thawv nkag.

Thaum peb tau nyem tseg lub app ua tiav! Txhawm rau muab nws tso rau hauv peb lub xov tooj peb tuaj yeem tshaj tawm thiab thaum ua tiav peb tuaj yeem hla mus qhia thiab nyem rau QR code uas peb tuaj yeem luam theej duab nrog peb lub xov tooj.

Kauj Ruam 7: Txuas thiab Txuas

Txuas thiab txuas
Txuas thiab txuas

Yog li tam sim no qhov kawg uas peb yuav tsum tau ua yog txuas peb lub zog ntsuas mus rau peb lub rooj tsav xwm IoT thiab tom qab ntawd txuas peb lub rooj tsav xwm IoT rau peb lub xov tooj.

Yog li txuas peb lub lauj kaub rau peb lub cuab yeej IoT yog qhov yooj yim heev txhua yam peb yuav tsum tau ua yog txuas tus pin nruab nrab ntawm lub lauj kaub rau A0 ntawm IoT board tom qab ntawd peb txuas tus pin sab laug ntawm lub lauj kaub rau 3.3 volts thiab thaum kawg peb txuas txoj cai ntawm lub lauj kaub rau hauv av ntawm peb pawg IoT.

Tam sim no txhawm rau txuas peb lub rooj sib tham IoT rau peb lub xov tooj txhua yam peb yuav tsum tau ua yog txuas koj lub xov tooj mus rau IoT boards wifi uas yuav tsum yooj yim nrhiav tau txij li thaum peb tau muab nws lub npe tshwj xeeb hauv teeb tsa. (yog tias koj tsis tau muab nws lub npe tshwj xeeb lub npe wifi tsis raug yog YourDeviceName thiab tus password yog YourDevicePassword). Thaum cov khoom siv txuas nrog peb tuaj yeem rov qab mus rau lub vev xaib app thiab koj yuav tsum pom qhov txiaj ntsig pib ntws hauv.

Kauj Ruam 8: Ua Nws Ntxiv

Coj Nws Ntxiv!
Coj Nws Ntxiv!

Yog li hauv txoj haujlwm no, peb tau kawm yuav ua li cas xa rov qab cov ntaub ntawv nyoos los ntawm lub sensor mus rau peb lub xov tooj, tam sim no hauv nws lub xeev tam sim no qhov no tsis muaj txiaj ntsig txawm li cas los xij xav txog ntsaws rau hauv lub sensor thiab teeb tsa koj lub app kom ua qee yam thaum lub sensor mus txog yam muaj txiaj ntsig - yam tau txais ntau yam txaus nyiam

Ua tsaug ntau ntau rau kev saib ib txwm yog tias koj muaj lus nug peb yuav muaj nyob hauv cov lus los pab tawm.

Pom zoo: