Cov txheej txheem:
- Kauj ruam 1: Tsim
- Kauj ruam 2: Code
- Kauj Ruam 3: Txuas mus rau HTTPS Lub Vev Xaib
- Kauj Ruam 4: Ua POST / GET Thov
- Kauj Ruam 5: JSON & NOKIA LCD
Video: Txuas Txuas Txuas Txuas: 5 Cov Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:27
Nyob zoo! Hauv qhov kev qhia no koj yuav pom yuav ua li cas txuas ib qho khoom siv Arduino sib xws, nruab nrog WiFi, rau REST APIs! Qhov no siv GitKraken Glo Board webapp los tsim cov laug cam, kab thiab daim npav los npaj khoom!
Qee qhov kev paub ntawm yuav ua li cas pej xeem API ua haujlwm xav tau. Txoj haujlwm no yog siv los siv GitKraken Glo's API txhawm rau taug qab lub sijhawm koj siv rau kev ua haujlwm ntawm koj Cov npe ua.
Piv txwv li, koj yuav tsum tau ua cov haujlwm no:
- Haus kas fes
Koj nias pib thaum koj pib, thaum koj ua tiav, koj nias Ua tiav, thiab voilà, lub sijhawm koj siv tau txais kev tawm tswv yim.
Kauj ruam 1: Tsim
Txhawm rau tsim, koj tuaj yeem xav txog dab tsi. Lub moos me me yuav zoo heev, tab sis kuv tsis tau ua dab tsi me me tso ib ncig.
Yog li cardboard thiab arcade laub khawm yog txoj hauv kev mus!
Pawg thawj coj kuv siv yog ESP8266 WeMos D1 Mini. Qhov no pheej yig dua li Arduino, thiab muaj WiFi onboard!
Lub vijtsam yog Nokia 5110 LCD.
n
Daim ntawv teev npe ntawm AliExpress:
- Nokia 5110 NPE
- 2 Arcade Nyees khawm
- ESP8266
- Jumper xov hlau
- Lub thawv ntawv
Tab sis koj tuaj yeem pom nws nyob qhov twg lossis ntawm lwm lub vev xaib zoo li Amazon lossis eBay.
Cov nqi tag nrho: 5 € 86
Pins kev sib txuas:
ESP8266 WeMos D1 Mini, Nokia 5110 LCD
- D2 (GPIO4) ↔ 0 RST
- D1 (GPIO5) ↔ 1 CE
- D6 (GPIO12) ↔ 2 DC
- D7 (GPIO13) ↔ 3 DIN
- D5 (GPIO14) ↔ 4 CLK
- 3V3 ↔ 5 VCC
- D0 (GPIO16) ↔ 6 BL
- G (GND) ↔ 7 GND
ESP8266 WeMos D1 Mini -Arcade Nyees khawm
D3 (GPI18) ↔ Left Button
D4 (GPI17), Txoj Cai Khawm
Khawm lwm tus pin txuas nrog hauv av (GND).
Kauj ruam 2: Code
Tsuas yog muab tus lej rau kuv
Koj tuaj yeem pom tag nrho cov cai ntawm no:
github.com/antoinech/glo-stopwatch
Txhawm rau nws ua haujlwm rau koj, koj yuav tsum tau hloov cov kev hloov pauv no:
// Muab koj daim ntawv pov thawj WiFi tso rau ntawm no charst* ssid = "--your-ssid--"; const char* password = "--your-password--"; // Muab Koj Tus Kheej Tus Kheej (Token Access token) (https://support.gitkraken.com/developers/pats/) const char *bearer = "Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
Koj tseem yuav xav tau 2 lub tsev qiv ntawv Adafruit:
github.com/adafruit/Adafruit-GFX-Library
github.com/adafruit/Adafruit-PCD8544-Nokia…
Thiab qhov txaus ntshai Arduino Json:
arduinojson.org/
Cov lus piav qhia
Hauv qhov chaws koj yuav pom:
- yuav ua li cas txuas rau HTTPS qhov kawg
- yuav ua li cas POST lossis GET thov
- yuav ua li cas serialize JSON cov lus teb kom tau txais cov khoom thiab cov pawg
- yuav ua li cas tso saib cov ntawv thiab duab hauv Nokia 5110 LCD
Yog tias koj xav kawm paub ntau ntxiv txog qhov API no:
support.gitkraken.com/developers/overview/
Cov kev thov no tuaj yeem ua haujlwm nrog ib qho API nyob deb uas siv POST thiab GET thov:)
Kauj Ruam 3: Txuas mus rau HTTPS Lub Vev Xaib
Tus lej pseudo no piav qhia koj yuav ua li cas txuas rau HTTPS lub vev xaib. Nws thawj kauj ruam yog tib yam li nrog a
WiFiClient tus thov kev pab
tab sis nrog cov kauj ruam pov thawj. Koj yuav tsum mus rau API qhov kawg koj xav txheeb xyuas, thiab txheeb xyuas daim ntawv pov thawj SHA1 ntiv tes. Luam muab tshuaj txhuam nws ua ib txoj hlua hauv koj tus lej thiab hu rau tus neeg siv khoom.verify (ntiv tes, hosturl).
WiFiClientSecure tus neeg siv khoom;
// Txuas rau WiFi WiFi.mode (WIFI_STA); WiFi.begin (ssid, password); thaum (WiFi.status ()! = WL_CONNECTED) {ncua (500); Serial.print ("."); } yog (! client.connect (tus tswv, httpsPort)) {Serial.println ("txuas tsis tau"); rov qab; } yog (client.verify (ntiv tes, tus tswv)) {Serial.println ("daim ntawv pov thawj sib xws"); } lwm {Serial.println ("daim ntawv pov thawj tsis phim"); }
Kauj Ruam 4: Ua POST / GET Thov
NCO NTSOOV
Nov yog cov syntax los ua POST thov:
Txoj hlua PostData = "{"; PostData += "\" text / ": \" kuv cov lus / ""; PostData += "}"; Serial.print (PostData); client.print (String ("POST") + url + "HTTP/1.1 / r / n" + "Host:" + host + "\ r / n" + "Authorization:" + bearer + "\ r / n" + "User-Agent: BuildFailureDetectorESP8266 / r / n" + "cache-control: no-cache / r / n" + "Content-Type: application/json / r / n" + "Content-Length:" + PostData. ntev () + "\ r / n" + "\ r / n" + PostData + "\ n"); Serial.println ("thov xa");
PostData yog cov ntaub ntawv koj xa ua JSON, hauv qhov no:
{
"text": "Kuv cov lus"}
Qhov hloov pauv url yog qhov kawg ntawm qhov url, tus tswv, lub vev xaib url, tus neeg nqa khoom yog API nkag mus token.
TAU
Nov yog pseudo-code rau GET thov:
client.print (String ("GET") + url + "HTTP/1.1 / r / n" + "Host:" + host + "\ r / n" + "Authorization:" + bearer + "\ r / n" + "User-Agent: BuildFailureDetectorESP8266 / r / n" + "Kev sib txuas: khaws-ciaj sia / r / n / r / n"); Serial.println ("thov xa"); thaum (client.connected ()) {Txoj kab = client.readStringUntil ('\ n'); yog (kab == "\ r") {Serial.println ("headers tau txais"); tawg; }} Txoj hlua kab = client.readStringUntil ('\ n');
Qhov tshwm sim ntawm cov lus txib no yuav muab khaws cia rau hauv kab sib txawv.
Kauj Ruam 5: JSON & NOKIA LCD
Txhawm rau ua tiav txoj haujlwm zoo sib xws, koj yuav tsum tso saib cov duab, cov ntawv thiab cov cim rau Nokia 5110 LCD. Koj tuaj yeem saib ntawm No Hauv Qhov Tutorial Tutorial los ntawm lastminuteengineers.
Txhawm rau tswj JSON hauv Arduino C ++, siv ArduinoJson lub vev xaib uas yuav qhia koj txhua yam txog nws!
Tsis txhob ua siab deb tshaj tawm cov lus nug yog tias koj muaj, lossis tshaj tawm qhov koj tau ua nrog qhov chaws no / qhia.
Pom zoo:
Cov av noo noo Cov Lus Qhia Tswj Xyuas Internet Txuas Cov Dej Dej (ESP32 thiab Blynk): 5 Cov Kauj Ruam
Cov av noo noo Cov lus pom zoo Tswj Xyuas Internet Txuas Cov Dej Dej (ESP32 thiab Blynk): Tsis txhawj xeeb txog koj lub vaj lossis nroj tsuag thaum koj mus rau hnub so ntev, lossis tsis nco qab ywg dej koj cov nroj tsuag txhua hnub. Zoo ntawm no yog kev daws teeb meem Nws cov av ya raws tswj hwm thiab thoob ntiaj teb txuas nrog cov dej txau dej tswj los ntawm ESP32 ntawm software pem hauv ntej kuv
Tuav Koj Tes Los Tswj OWI Robotic Arm Tsis Muaj Cov Txuas Txuas: 10 Cov Kauj Ruam (nrog Duab)
Yooj Yim Koj Tes Los Tswj OWI Neeg Hlau Caj Npab … Tsis Muaj Cov hlua txuas: Tus IDEA: Muaj tsawg kawg 4 lwm txoj haujlwm ntawm Instructables.com (raws li lub Tsib Hlis 13, 2015) ib puag ncig hloov kho lossis tswj OWI Robotic Arm. Tsis xav tsis thoob, txij li nws yog qhov khoom siv zoo tshaj plaws thiab pheej yig cov neeg hlau ua si nrog. Qhov project no zoo sib xws hauv s
Kev Sib Txuas Txuas Txuas Txuas Siv Bluefruit: 4 Cov Kauj Ruam
Kev Sib Txuas Tsis Sib Txuas Siv Bluefruit: Nov yog cov lus qhia yooj yim los ntawm kauj ruam qhia los hloov koj cov xov hlau nrog bluetooth tsis muaj zog txuas: Nws coj kuv ib pliag los daws qhov no vim tias tsis muaj cov ntaub ntawv hais txog kev ua qhov no nrog bluetooth niaj hnub tsis muaj zog thev naus laus zis raws li Bluefrui
EZ Kev Sib Txuas Txuas Txuas Txuas Ntxiv - Tsis Muaj Tus Kheej! (CSRC-311): 7 Kauj Ruam
EZ Kev Sib Txuas Txuas Txuas Txuas Ntxiv - Tsis Muaj Tus Kheej! (CSRC-311): Tsis ntev dhau los ntawm Azamom.com (thov txim, tam sim no tau muag tawm) Kuv tau hla qhov kev pom zoo zoo ntawm Common Sense RC CSRC-311 tus qauv-siv servos.Noj zoo, Kuv xav hloov qee yam ntawm tsis tu ncua kev sib hloov. Txoj kev kuv tuaj nrog yog yooj yim heev thiab xav tau
Cov lus qhia rau Ua Plaub Qhov Kev Txuas Txuas Txuas Rau Qhov Chaw Mounted Footrest: 9 Cov Kauj Ruam (nrog Duab)
Cov lus qhia rau Ua Plaub Qhov Kev Txuas Txuas Txuas Rau Lub Hauv Paus Mounted Footrest: Mid-drive fais fab log lub rooj zaum (PWC) tau dhau los ua neeg nyiam nyob rau xyoo tas los no. Txawm li cas los xij, vim qhov kev tso rau pem hauv ntej casters, cov tsoos sab-mounted footrests tau hloov los ntawm ib qho chaw nruab nrab-footrest. Hmoov tsis zoo, center-mou