Cov txheej txheem:
- Kauj Ruam 1: Cov Cheeb Tsam Xav Tau
- Kauj Ruam 2: Teeb tsa Slack Incoming Webhook
- Kauj Ruam 3: Particle Photon
- Kauj Ruam 4: Particle Web IDE
- Kauj Ruam 5: Tsim Particle Webhook
- Kauj Ruam 6: Daim duab Circuit Court
- Kauj Ruam 7: Txoj Haujlwm
- Kauj Ruam 8: Qhov tshwm sim
Video: Rooj Sib Tham Saib Xyuas Kev Siv Particle Photon: 8 Cov Kauj Ruam (nrog Duab)
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:27
Taw qhia
Hauv qhov kev qhia no peb yuav ua lub rooj sib tham saib xyuas siv Particle Photon. Hauv Qhov Kev Sib Tham no tau koom ua ke nrog Slack siv Webhooks kom tau txais lub sijhawm hloov tshiab ntawm seb puas muaj chav nyob lossis tsis muaj. PIR sensors tau siv los txheeb xyuas qhov hloov pauv hloov hauv lub teeb infrared kom nkag siab tib neeg.
Ua ntej tshaj, teeb tsa Slack
Qhov thib ob, teeb tsa Particle
Kauj Ruam 1: Cov Cheeb Tsam Xav Tau
Kho vajtse
- Particle Photon ==> $ 19
- PIR sensor ==> $ 7
- LED ==> $ 2
Software
- Particle Web IDE
- Slack
Tus nqi tag nrho yog kwv yees $ 28
Kauj Ruam 2: Teeb tsa Slack Incoming Webhook
Ib Slack Tuaj Txog Webhook mloog cov ntaub ntawv los ntawm lwm qhov chaw thiab tom qab ntawv tshaj tawm nws mus rau Slack channel.
Thawj zaug mus rau https://slack.com/intl/en-in/ tom qab ntawd nkag mus rau koj tus email chaw nyob. Koj yuav pom nplooj ntawv zoo li no
Tsim qhov chaw ua haujlwm tshiab. Koj yuav pom nplooj ntawv zoo li no
Ua channel rau Webhook los tshaj tawm. Kuv tsim lub npe channel hu ua #conferenceroom
Tom ntej no, nyem lub iav icon thiab xaiv "Ntxiv ib qho app"
Tam sim no, tsim Webhook nws tus kheej. Ntaus cov webhooks nkag rau hauv lub npov tshawb nrhiav, tom qab ntawd nyem Cov Khoom WebHooks tuaj
Nyem rau ntawm lub webhooks tuaj koj yuav pom nplooj ntawv zoo li no
Tom qab ntawd nyem rau ntawm "ntxiv teeb tsa". Koj yuav pom nplooj ntawv zoo li no
Xaiv cov channel los tshaj tawm rau. Hauv qhov no, nws yog #conferenceroom
Nrhiav koj lub Webhook URL. Qhov URL no xa cov ntaub ntawv mus rau ntawm Particle Device Cloud
Scroll cia rau Kev Sib Koom Chaw thiab muab koj lub webhook sau cov ntawv piav qhia, lub npe, thiab lub cim, tom qab ntawv nyem Txuag Chaw
Peb ua tiav nrog Slack teeb tsa.
Kauj Ruam 3: Particle Photon
Photon yog pawg neeg IOT uas nrov tshaj plaws. Lub rooj tsav xwm hauv tsev STM32F205 120Mhz ARM Cortex M3 microcontroller thiab muaj 1 MB nco lub cim xeeb, 128 Kb RAM thiab 18 lub teeb liab sib xyaw ua ke lub hom phiaj tso zis tawm (GPIO) pins nrog cov khoom siv siab tshaj. Tus qauv muaj nyob rau ntawm board Cypress BCM43362 Wi-Fi nti rau Wi-nkaus txuas thiab Ib leeg band 2.4GHz IEEE 802.11b/g/n rau Bluetooth. Lub rooj tsavxwm tau nruab nrog 2 SPI, ib I2S, ib I2C, ib tus tuaj yeem thiab ib qho USB interface.
Nws yuav tsum tau sau tseg tias 3V3 yog cov lim dej tau siv rau kev ntsuas analog. Tus pin no yog qhov tso tawm ntawm tus tswj hwm ntawm lub rooj tsavxwm thiab txuas nrog sab hauv nrog VDD ntawm Wi-nkaus module. Thaum fais fab Photon ntawm VIN lossis USB chaw nres nkoj, tus pin no yuav tso tawm qhov hluav taws xob ntawm 3.3VDC. Tus pin no tseem tuaj yeem siv los txhawb lub zog Photon ncaj qha (cov tswv yim siab tshaj 3.3VDC). Thaum siv los ua qhov tso tawm, qhov siab tshaj plaws ntawm 3V3 yog 100mA. PWM cov cim muaj kev daws teeb meem ntawm 8-ntsis thiab ua haujlwm ntawm 500 Hz.
Pin Diagram
Nqe lus piav qhia
Kauj Ruam 4: Particle Web IDE
Txog kev sau cov phiaj xwm txheej txheem rau ib qho Photon, tus tsim tawm yuav tsum tsim tus as khauj hauv Particle lub vev xaib thiab sau npe rau Photon board nrog nws tus lej siv. Txoj cai program yuav tuaj yeem sau rau ntawm Web IDE ntawm Particle lub vev xaib thiab xa mus rau daim ntawv sau npe hauv internet. Yog tias pawg thawj coj saib xyuas xaiv, Photon ntawm no, tau hloov pauv thiab txuas nrog huab kev pabcuam ntawm Particle, cov cai tau hlawv mus rau pawg tswj hwm xaiv hla huab cua ntawm kev sib txuas hauv is taws nem thiab pawg thawj coj pib ua haujlwm raws li qhov hloov pauv. Txog kev tswj hwm pawg thawj coj hauv is taws nem, nplooj ntawv web tau tsim los uas siv Ajax thiab JQuery xa cov ntaub ntawv mus rau pawg thawj coj siv HTTP POST method. Lub vev xaib txheeb xyuas lub rooj tsavxwm los ntawm tus lej ntaus ntawv thiab txuas rau Particle's Cloud Service los ntawm kev nkag mus rau token.
Yuav ua li cas txuas photon nrog Internet1. Fais fab koj ntaus ntawv
- Txuas lub USB cable rau hauv koj lub hwj chim.
- Sai li nws tau ntsaws, RGB LED ntawm koj lub cuab yeej yuav tsum pib ntsais muag xiav. Yog tias koj lub cuab yeej tsis ntsais muag xiav, tuav lub pob SETUP. Yog hais tias koj lub cuab yeej tsis ntsais muag tag nrho, lossis yog tias lub LED kub hnyiab txiv kab ntxwv xim, nws yuav tsis tau txais lub zog txaus. Sim hloov koj lub zog lossis USB cable.
2. Txuas koj Photon rau Is Taws Nem
Muaj ob txoj hauv kev yog koj siv web application lossis mobile app
a Kev siv web daim ntawv thov
- Kauj ruam 1 Mus rau setup.particle.io
- Kauj ruam 2 Nyem rau teeb tsa Photon
- Kauj Ruam 3 Tom qab nyem rau NEXT, koj yuav tsum tau nthuav tawm nrog cov ntawv (photonsetup.html)
- Kauj ruam 4 Qhib cov ntawv.
- Kauj Ruam 5 Tom qab qhib cov ntawv txuas koj lub PC rau Photon, los ntawm kev txuas mus rau lub network npe PHOTON.
- Kauj Ruam 6 Kho koj li ntaub ntawv pov thawj Wi-Fi. Ntau: Yog tias koj ua yuam kev koj li ntawv pov thawj, Photon yuav ntsais xiav xiav lossis ntsuab. Koj yuav tsum mus dhau cov txheej txheem dua (los ntawm kev rov ua nplooj ntawv lossis nyem rau ntawm qhov txheej txheem rov ua dua)
- Kauj ruam 7 Hloov koj lub cuab yeej. Koj tseem yuav pom qhov kev lees paub yog tias lub cuab yeej tau thov lossis tsis yog.
b. Siv smartphone
- Qhib lub app ntawm koj lub xov tooj. Nkag mus lossis kos npe rau tus as khauj nrog Particle yog tias koj tsis muaj.
- Tom qab nkag mus, nias lub cim ntxiv thiab xaiv lub cuab yeej koj xav ntxiv. Tom qab ntawd ua raws cov lus qhia ntawm lub vijtsam txhawm rau txuas koj lub cuab yeej rau Wi-nkaus. Yog tias qhov no yog koj li Photon thawj zaug sib txuas, nws yuav ntsais liab doog rau ob peb feeb thaum nws rub tawm tshiab. Nws yuav siv sijhawm 6-12 feeb rau qhov hloov tshiab kom ua tiav, nyob ntawm koj li kev txuas hauv is taws nem, nrog Photon rov pib dua ob peb zaug hauv tus txheej txheem. Tsis txhob rov pib dua lossis tshem koj lub Photon lub sijhawm no.
Thaum koj tau txuas koj lub cuab yeej, nws tau kawm lub network ntawd. Koj lub cuab yeej tuaj yeem khaws txog tsib lub network. Txhawm rau ntxiv lub network tshiab tom qab koj teeb tsa thawj zaug, koj yuav tso koj lub cuab yeej rau hauv Hom Mloog dua thiab ua raws li saum toj no. Yog tias koj zoo li koj lub cuab yeej muaj ntau lub network ntawm nws, koj tuaj yeem so koj lub cuab yeej nco ntawm ib qho Wi-nkaus tes hauj lwm nws tau kawm. Koj tuaj yeem ua tau los ntawm kev txuas ntxiv tuav lub pob teeb tsa rau 10 vib nas this kom txog thaum RGB LED ntsais muag xiav sai, qhia tau tias txhua qhov profile tau raug tshem tawm.
Hom
- Cyan, koj Photon txuas nrog Internet.
- Magenta, tam sim no nws tau rub tawm app lossis hloov kho nws cov firmware. Lub xeev no tau tshwm sim los ntawm kev hloov kho firmware lossis los ntawm qhov ua kom pom tseeb los ntawm Web IDE lossis Desktop IDE. Koj yuav pom hom no thaum koj txuas koj Photon rau huab thawj zaug.
- Ntsuab, nws tau sim txuas rau hauv is taws nem.
- Dawb, Wi-nkaus module raug kaw.
Web IDEParticle Tsim yog Kev Txhim Kho Ib Leeg Ib puag ncig, lossis IDE uas txhais tau tias koj tuaj yeem tsim kho software hauv daim ntawv thov siv tau yooj yim, uas tsuas yog tshwm sim los ua haujlwm hauv koj lub vev xaib.
Txhawm rau qhib tsim, nkag mus rau koj tus lej nyiaj thiab tom qab ntawd nyem rau ntawm Web IDE raws li qhia hauv duab
Thaum koj nyem koj yuav pom console zoo li no
Txhawm rau tsim qhov tsim tshiab app, nyem rau ntawm tsim app tshiab
Txhawm rau txheeb xyuas qhov program. Nyem rau qhov tseeb
Txhawm rau upload cov cai, nyem rau nyem tab sis ua ntej ua qhov ntawd xaiv lub cuab yeej. Nyem rau ntawm "Devices" lub cim nyob rau hauv qab sab laug ntawm lub pane navigation, tom qab ntawd thaum koj yuj hla lub npe ntaus ntawv lub hnub qub yuav tshwm ntawm sab laug. Nyem rau nws kom teeb tsa lub cuab yeej uas koj nyiam hloov kho (nws yuav tsis pom yog tias koj tsuas muaj ib lub cuab yeej). Thaum koj tau xaiv lub cuab yeej, lub hnub qub cuam tshuam nrog nws yuav tig daj. (Yog tias koj tsuas muaj ib lub cuab yeej, tsis tas yuav xaiv nws, koj tuaj yeem txuas ntxiv mus
Kauj Ruam 5: Tsim Particle Webhook
Ntau Slack kev koom ua ke xav tau nplooj siab web servers khiav PHP cov ntawv sau los ua cov ntaub ntawv mus thiab los ntawm Slack. Txawm li cas los xij, hauv peb qhov xwm txheej peb tsuas yog siv Particle webhook los qhia rau Slack webhook seb puas muaj chav sib tham lossis tsis muaj.
Peb xav tau ob lub webhooks ib qho rau conf_avail thiab thib ob rau conf_inuse (koj tuaj yeem siv lub npe twg).
Mus rau Particle Console thiab nyem rau Kev Sib Koom tab, tom qab ntawd nyem Tshiab Kev Sib Koom
Nyem Webhook kom pib Webhook Builder
Hauv Webhook Builder hauv qab Lub Npe Lub Npe sau conf_avail. Muab tshuaj txhuam koj Slack webhook URL hauv qab URL. Hloov Thov Hom Ntawv rau JSON
Nthuav Advanced Chaw thiab xaiv Kev Cai raws li JSON Cov Ntaub Ntawv. Muab tshuaj txhuam cov cai hauv qab no
Rov ua tib cov kauj ruam rau conf_inuse
Nco tseg:- Lub npe ntawm qhov xwm txheej tau tshaj tawm tau ua raws qhov xwm txheej lub npe txheej xwm hauv webhook.
Kauj Ruam 6: Daim duab Circuit Court
Particle Photon ==> PIR sensor
Vin ==> Vcc
GND ==> GND
D0 ==> Cov zis
Particle Photon ==> LED
- D2 ==> +Ve (Anode)
- GND ==> -Ve (Cathode)
Kauj Ruam 7: Txoj Haujlwm
Kauj Ruam 8: Qhov tshwm sim
Khiav Tawm hauv IoT Challenge
Pom zoo:
THIAB LUB NEEJ !! (Sib tham sib tham rooj sib tham): 4 Kauj Ruam
THIAB LUB NEEJ !! (sib tham sib tham txog Thruth Table): Nyob zoo cov phooj ywg, Kuv vam tias koj txhua tus nyob hauv koj lub tsev zoo thiab xav tsis thoob dab tsi ntawm cov ntaub ntawv uas muaj ?? Nkag siab cov rooj vag logic yog qhov tseem ceeb heev rau ob leeg
Kev Nyuaj Siab: Kev Saib Xyuas thiab Saib Xyuas Ntxiv rau Kev Teeb Meem: 9 Cov Kauj Ruam
Hard Drive: Kev Saib Xyuas thiab Kev Saib Xyuas Ntxiv Teeb Meem: Daim duab saum toj no yog Hard Drive ib txwm muaj. Cov no yog cov tsav tsheb feem ntau siv niaj hnub no, tab sis tsis tas yuav nrawm tshaj. Tib neeg siv tus tsav no rau nws tus nqi qis dua gigabyte thiab lub neej ntev dua. Phau ntawv qhia no yuav qhia koj txog qhov sib txawv
Qhov Sib Txawv Ntawm Lub Rooj Sib Tham Lub Rooj Sib Tham Lub Hwj Huam!: 6 Kauj Ruam (nrog Duab)
Qhov Sib Txawv Ntawm Lub Rooj Sib Tham Bench Power Supply!: Koj puas tau tsim koj qhov haujlwm tshiab thiab tuav rov qab los ntawm qhov koj tsis muaj kev tswj hwm koj li peev txheej? Zoo, qhov no yog qhov haujlwm rau koj! Hnub no kuv yuav qhia koj yuav ua li cas thiaj tsim tau lub rooj zaum hauv lub rooj zaum ua haujlwm tau zoo rau qhov pheej yig heev! Kuv tau ua qhov no tag nrho
Dot² - Kev Sib Tham Sib Tham Rooj: 12 Cov Kauj Ruam (nrog Duab)
Dot² - Kev Sib Tham Sib Tham Rooj: Thaum kuv xyaum ua haujlwm, Kuv tau tsim cov lus sib tham uas koj tuaj yeem khiav cov duab, qee qhov txaus nyiam LED Teeb thiab yog, Ua si tsev kawm ntawv qub ua si !! Kuv tau txais kev tshoov siab los tsim lub rooj kas fes no los ntawm crt4041's Music Visualiser Table yog tswj
Cov Neeg Siv Yooj Yim Sib Tham Sib Tham rau Kev Qhia thiab Kev Ntsuam Xyuas: 11 Kauj Ruam
Cov Neeg Siv Yooj Yim Sib Tham Sib Tham rau Kev Qhia thiab Kev Ntsuam Xyuas: Txoj haujlwm no tau tsim los ua ib feem ntawm chav kawm hauv tsev kawm qib siab, lub hom phiaj yog ua kom muaj kev sib tham sib tham los qhia thiab ntsuas qee yam ncauj lus. Rau nws peb tau siv Kev Ua Haujlwm ntawm PC rau lub interface thiab Arduino NANO rau lub khawm arcade thiab LEDs, yog li