Cov txheej txheem:
- Kauj Ruam 1: Cov Ntais Tseem Ceeb
- Kauj Ruam 2: Sib Piv Ntawm ESP32, ESP8266 thiab Arduino R3
- Kauj Ruam 3: Hom ESP32
- Kauj Ruam 4: WiFi NodeMCU-32S ESP-WROOM-32
- Kauj Ruam 5: Kho Arduino IDE (Windows)
- Kauj ruam 6: WiFi Scan
- Kauj ruam 7: Code
- Kauj ruam 8: Teeb tsa
- Kauj ruam 9: Loop
- Kauj ruam 10: Cov ntaub ntawv
Video: Taw qhia rau ESP32: 10 Cov Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:29
Hauv kab lus no peb yuav tham txog ESP32, uas kuv xav tias yog tus tij laug ntawm ESP8266. Kuv nyiam qhov microcontroller no tiag tiag vim nws muaj WiFi. Tsuas yog koj muaj lub tswv yim, ua ntej ESP muaj, yog tias koj xav tau Arduino kom muaj WiFi, koj yuav tsum tau siv nruab nrab ntawm $ 200 thiab $ 300 los yuav Wifi adapter. Tus adapter rau network cable tsis kim heev, tab sis rau WiFi nws ib txwm ua thiab tseem kim. Tab sis hmoov zoo, Espressif Systems tau tshaj tawm ESP thiab tab tom daws peb lub neej.
Kuv nyiam ESP32 nrog hom ntawv no uas muaj USB chaw nres nkoj. Cov phiaj xwm NodeMCU no yooj yim los tswj vim nws tsis xav tau cov khoom siv hluav taws xob. Tsuas yog ntsaws rau hauv kab, txuas lub cuab yeej thiab ua haujlwm rau nws. Nws ua haujlwm zoo ib yam li Arduino.
Xijpeem, hnub no peb yuav tham txog txhua yam ntawm ESP32 thiab yuav teeb tsa Arduino IDE li cas rau ntau yam khoom siv ntawm hom. Tsis tas li peb yuav ua qhov haujlwm uas tshawb xyuas cov tes hauj lwm thiab qhia qhov twg yog qhov muaj zog dua.
Kauj Ruam 1: Cov Ntais Tseem Ceeb
Chip nrog built-in WiFi: tus qauv 802.11 B / G / N, ua haujlwm nyob ntawm thaj tsam 2.4 txog 2.5GHz
Hom kev ua haujlwm: Client, Access Point, Station + Access Point
Dual core microprocessor Tensilica Xtensa 32-ntsis LX6
Kho lub moos los ntawm 80MHz txog 240MHz
Ua haujlwm voltage: 3.3 VDC
Nws muaj SRAM ntawm 512KB
Nta 448KB ROM
Nws muaj lub cim xeeb sab nraud ntawm 32Mb (4 megabytes)
Qhov siab tshaj tam sim no rau tus pin yog 12mA (nws raug nquahu kom siv 6mA)
Nws muaj 36 GPIOs
GPIOs nrog PWM / I2C thiab SPI kev ua haujlwm
Nws muaj Bluetooth v4.2 BR / EDR thiab BLE (Bluetooth Tsawg Zog)
Kauj Ruam 2: Sib Piv Ntawm ESP32, ESP8266 thiab Arduino R3
Kauj Ruam 3: Hom ESP32
ESP32 tau yug los nrog ntau tus nus muag. Hnub no kuv siv thawj zaug los ntawm sab laug, Espressif, tab sis muaj ntau lub npe thiab hom, suav nrog Oled zaub built-in. Txawm li cas los xij, qhov sib txawv yog txhua yam tib lub nti: Tensilica LX6, 2 Core.
Kauj Ruam 4: WiFi NodeMCU-32S ESP-WROOM-32
Nov yog daim duab ESP uas peb tab tom siv hauv peb lub rooj sib txoos. Nws yog lub nti uas muaj ntau qhov kev thov thiab lub zog. Lawv yog ob peb tus pin koj xaiv seb lawv xav ua haujlwm li digital analog, analog digital lossis txawm tias qhov ntawd ua haujlwm lub qhov rooj zoo li digital.
Kauj Ruam 5: Kho Arduino IDE (Windows)
Nov yog yuav teeb tsa Arduino IDE yog li peb tuaj yeem suav sau rau ESP32:
1. Rub cov ntawv los ntawm qhov txuas:
2. Unzip cov ntawv thiab luam cov ntsiab lus rau hauv qab no:
C: / Users / [YOUR_USER_NAME] / Documents / Arduino / hardware / espressif / esp32
Nco tseg: Yog tias tsis muaj cov npe "espressif" thiab "esp32", tsuas yog tsim lawv ib txwm muaj.
3. Qhib phau ntawv teev npe
C: / Users / [YOUR_USER_NAME] / Documents / Arduino / hardware / espressif / esp32 / cov cuab yeej
Khiav cov ntaub ntawv "get.exe".
4. Tom qab qhov "get.exe" ua tiav, ntsaws ESP32, tos kom cov tsav tsheb raug teeb tsa (lossis teeb tsa tus kheej).
Npaj txhij, tam sim no tsuas yog xaiv ESP32 pawg thawj coj hauv "cuab yeej >> pawg thawj coj saib" thiab sau koj cov cai.
Kauj ruam 6: WiFi Scan
Nov yog qhov piv txwv ntawm yuav ua li cas thiaj nrhiav tau cov WiFi sib txuas nyob ze ESP-32, nrog rau lub teeb liab lub zog ntawm txhua tus ntawm lawv. Nrog txhua qhov scan, peb tseem yuav pom tias lub network twg muaj lub teeb liab zoo tshaj plaws.
Kauj ruam 7: Code
Ua ntej peb suav nrog lub tsev qiv ntawv "WiFi.h", nws yuav tsim nyog tso cai rau peb ua haujlwm nrog daim npav network ntawm peb lub cuab yeej.
#suav nrog "WiFi.h"
Nov yog ob qhov kev hloov pauv uas yuav siv los khaws lub network SSID (lub npe) thiab lub zog teeb liab.
Txoj hlua networkSSID = ""; int zogSignal = -9999;
Kauj ruam 8: Teeb tsa
Hauv kev teeb tsa () muaj nuj nqi, peb yuav txheeb xyuas hom WiFi tus cwj pwm ntawm peb lub cuab yeej. Hauv qhov no, txij li lub hom phiaj yog txhawm rau tshawb nrhiav cov network uas muaj, peb yuav teeb tsa peb lub cuab yeej kom ua haujlwm "chaw nres tsheb".
void teeb () {// Initialize Serial nkag mus rau hauv Serial Monitor Serial.begin (115200);
// teeb tsa hom kev ua haujlwm ntawm WiFi raws li chaw nres tsheb WiFi.mode (WIFI_STA); // WIFI_STA yog qhov txuas tas li qhia qhov chaw nres tsheb
// txiav tawm ntawm qhov nkag mus yog nws twb txuas nrog WiFi.disconnect (); ncua (100);
// Serial.println ("Teeb tsa ua tiav");}
Kauj ruam 9: Loop
Hauv lub voj () ua haujlwm, peb yuav tshawb rau cov tes hauj lwm uas muaj thiab tom qab ntawd luam tawm cov cav hauv cov tes hauj lwm pom. Rau txhua ntawm cov tes hauj lwm no peb yuav ua qhov sib piv kom pom qhov uas muaj lub teeb liab siab tshaj plaws.
void loop () {// Serial.println ("pib scan"); // ua qhov kev txheeb xyuas ntawm cov tes hauj lwm uas muaj
int n = WiFi.scanNetworks ();
Serial.println ("Ua tiav Scan");
// txheeb xyuas yog tias koj tau pom ib lub network yog (n == 0) {Serial.println ("Tsis pom lub network"); } lwm {networkSSID = ""; StrengthSignal = -9999; Serial.print (n); Serial.println ("network pom / n"); rau (int i = 0; i <n; ++ i) {// luam tawm ntawm tus saib xyuas txhua tus ntawm tes hauj lwm pom Serial.print ("SSID:"); Serial.println (WiFi. SSID (kuv)); // network npe (ssid) Serial.print ("SIGNAL:"); Serial.print (WiFi. RSSI (kuv)); // teeb liab lub zog Serial.print ("\ t / tCHANNEL:"); Serial.print ((int) WiFi.channel (kuv)); Serial.print ("\ t / tMAC:"); Serial.print (WiFi. BSSIDstr (kuv)); Serial.println ("\ n / n"); yog (abs (WiFi. RSSI (i)) <abs (lub zogSignal)) {lub zogSignal = WiFi. RSSI (kuv); networkSSID = WiFi. SSID (kuv); Serial.print ("NETWORK nrog ZOO TSHAJ PLAWS ZOO TSHAJ PLAWS: ("); Serial.print (networkSSID); Serial.print (") - SIGNAL: ("); Serial.print (strengthSignal); Serial.println (")"); } ncua (10); }} Serial.println ("\ n ----------------------------------------- ------------------------------------------- / n ");
// ncua sijhawm 5 vib nas this los ua qhov kev ncua scan tshiab (5000); }
"Yog tias (abs (WiFi. RSSI (i)))"
Nco ntsoov tias hauv nqe lus saum toj no peb siv abs (), txoj haujlwm no siv tus nqi meej (piv txwv li tsis zoo) ntawm tus lej. Hauv peb qhov xwm txheej peb tau ua qhov no txhawm rau nrhiav qhov tsawg tshaj plaws ntawm cov txiaj ntsig hauv kev sib piv, vim tias lub teeb liab siv tau muab ua tus lej tsis zoo thiab ze rau xoom zoo dua lub teeb liab.
Kauj ruam 10: Cov ntaub ntawv
Rub tawm tag nrho kuv cov ntaub ntawv hauv: www.fernandok.com
Pom zoo:
LED Qhov Taw Qhia Qhov Taw Qhia Tus Menyuam: 5 Kauj Ruam (nrog Duab)
LED Qhov Taw Qhia Qhov Taw Qhia Tus dev: Kuv ib txwm coj kuv tus dev Rusio mus taug kev thaum lub hnub poob qis kom nws tuaj yeem ua si yam tsis tau kub heev. Qhov teeb meem yog tias thaum nws tawm ntawm txoj hlua qee zaum nws tau zoo siab heev thiab ua haujlwm ntau dua li nws yuav tsum thiab nrog lub teeb qis thiab lwm tus dev
Yuav Ua Li Cas Thiaj Li Taw Qhia Qhov Taw Qhia: 6 Kauj Ruam
Yuav Ua Li Cas Thiaj Li Qhia Tus Kheej: Lub hom phiaj tseem ceeb ntawm daim ntawv thov no yog txhawm rau ntsuas qhov hnyav ntawm ib yam khoom tom qab ntawd qhia nrog lub tswb nrov thaum muaj qhov hnyav dhau. Cov tswv yim ntawm lub kaw lus los ntawm lub xov tooj ntawm tes. Kev tawm tswv yim yog lub teeb liab sib piv uas tau nthuav dav los ntawm qhov sib txawv
Cov Khaub Ncaws Khaub Ncaws Jelly Donuts - Kev Taw Qhia rau Xaws Cov Khaub Ncaws Nrog Makey Makey: 4 Cov Kauj Ruam (nrog Duab)
Cov Khaub Ncaws Khaub Ncaws Khaub Ncaws - Kev Taw Qhia rau Xaws Cov Khaub Ncaws Nrog Makey Makey: Peb pom hauv Twitter tias ntau ntawm peb Cov Khaub Ncaws thiab Makey Makey cov neeg ntxeev siab xav paub ntau ntxiv txog kev xaws khaub ncaws, yog li peb tau tsim qhov kev qhia no kom qhia rau koj sai ntawm kev xaws khaub ncaws thiab yuav ua li cas koj tuaj yeem xaws qee cov khoom sib dhos. (Qhov no yog
Ib qho Micro: ntsis Qhia Taw Qhia rau Cov Khau Kaus mom: 5 Kauj Ruam
Tus Micro: ntsis Qhia Taw Qhia rau Cov Khau Khau Khau: Hloov Kho Tshiab 2018-Tsib Hlis-12 Hauv qab no koj cov lus qhia yuav ua li cas thiaj tsim tau micro yooj yim: me ntsis raws qhov taw qhia qhia rau lub kaus mom hlau kauj vab (lossis zoo sib xws). Nws siv cov accelerometers tsim hauv micro: me ntsis raws li kev tswj hwm. Cov ntawv sau ua nab nab nab yog opti
Taw qhia rau Robotics rau Cov Tub Kawm Ntawv Hauv Tsev Kawm Ntawv Nrog Hummingbird Controllers: 18 Cov Kauj Ruam
Taw qhia rau Robotics rau Cov Tub Ntxhais Kawm Hauv Tsev Kawm Ntawv Nrog Hummingbird Controllers: Feem ntau cov cuab yeej neeg hlau ntawm kev ua lag luam niaj hnub no xav kom tus neeg siv rub tawm cov software tshwj xeeb rau hauv lawv lub hard drive. Qhov zoo nkauj ntawm Hummingbird Robotic Controller yog qhov nws tuaj yeem ua haujlwm siv lub vev xaib hauv computer, xws li chromebook. Nws tseem yog