Cov txheej txheem:
- Kauj Ruam 1: Thawj Yam Ua Ntej
- Kauj ruam 2: Tsim Nyog Hardware
- Kauj Ruam 3: Arduino IDE Libraries for Compiling
- Kauj Ruam 4: Kev Sib Txuas
- Kauj ruam 5: Sketch Uploading
Video: Arduino Altimeter Siv BMP thiab SPI lossis I2C OLED: 5 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:29
Tau ntev kuv tau tshawb nrhiav qhov ntsuas kub thiab ntsuas kub siv ib qho ntsuas thiab tso tawm rau SPI raws li OLED. Raws li kuv nrhiav tsis tau ib yam meej, xav tias kuv yuav tsim kuv tus kheej siv U8glib lub tsev qiv ntawv. Muaj ib qho kev qhia hauv youtube tab sis kuv yeej ntxub cov vis dis aus qhia, Kuv nyiam cov ntawv nrog cov lus qhia ncaj qha thiab tsis muaj kev sib txuas ua lag luam.
Kauj Ruam 1: Thawj Yam Ua Ntej
Ua ntej ua txoj haujlwm no, Kuv xav kom koj ua kom tiav SSD1306/OLED qhia rau I2C lossis SPI (qhov twg koj xav siv). Qhov no yuav ua kom ntseeg tau tias koj paub yuav ua li cas txuas/xaim koj cov zaub, nrog rau koj cov zaub ua haujlwm. Ua cov lus qhia adafruit thiab/lossis u8glib piv txwv qhia. Peb yuav siv u8glib ntawm no yog li pom zoo rau cov neeg siv qib siab.
Kauj ruam 2: Tsim Nyog Hardware
1. Arduino UNO lossis Nano lossis zoo sib xws.
2. BMP085 lossis BMP180 Barometric Siab Sensor.
3. SSD1306 I2C lossis SPI Bus (Configurable in sketch).
4. Jumper xov hlau thiab daim ntawv qhia zaub mov lossis vero board rau kev sib txuas.
Kauj Ruam 3: Arduino IDE Libraries for Compiling
1. Wire.h
2. Adafruit_BMP085.h (yuav ua haujlwm rau BMP180 ib yam)
3. U8glib.h
Kauj Ruam 4: Kev Sib Txuas
Kev sib txuas zoo ib yam rau ob qho tib si I2C thiab SPI OLED zaub. Tsuas yog kev sib txuas los tso saib yuav txawv.
1. BMP rau Arduino:
VCC> 3.3V
GND> Hauv av
SCL> A5/SCL
SDA> A4/SDA
SCK = 12, MOSI = 11, CS = 10, A0 = 9, Pib dua = 13
2. SPI OLED rau Arduino
VDD> 5V
GND> Hauv av
SCK/D0> D12 (Digital 12)
SDA/D1/Mosi> D11
CS/Chip Xaiv> D10
A0/DC> D9
RES/Pib dua> D13
(Yog tias koj tus SPI OLED tsis muaj Pib dua tus pin ntawm nws tsuas yog tshem tawm pib dua thiab rov pib dua tus pin los ntawm daim duab kos xaiv xaiv tsis)
3. I2C OLED
Ib yam li BMP thaiv, lawv siv tib lub chaw nres nkoj thiab hom tsheb npav.
Kauj ruam 5: Sketch Uploading
Zoo nkauj ncaj. Tsuas yog rub tawm cov ntawv zip thiab qhib hauv Arduino IDE. Txhua yam yog teeb tsa hauv daim duab. SPI OLED cov neeg siv tsuas tuaj yeem tso cov duab kos yam tsis muaj kev kho thiab nws yuav ua haujlwm. Rau I2C OLED cov neeg siv, tsuas yog tsis txaus siab rau koj lub npe zaub/xaiv los ntawm Zaub Xaiv xaiv ntawm daim duab kos, thiab tawm tswv yim thiab kaw SPI Display qauv/ntsuas kom tsis siv SPI OLED.
SPI Zaub Parameter:
// U8GLIB_SSD1306_128X64 u8g (12, 11, 10, 9, 13); // SW SPI Com: SCK = 12, MOSI = 11, CS = 10, A0 = 9, Pib dua = 13
I2C Zaub Parameter:
// U8GLIB_SSD1306_128X64 u8g (U8G_I2C_OPT_NO_ACK); // Zaub uas tsis xa AC
Txhawm rau ua kom muaj qhov ntsuas, tsuas yog tshem tawm // kos npe thaum pib kom tsis tawm lus nws. Nco ntsoov tias tsuas yog ib qho zaub raug xaiv/tsis hais tawm.
Cov lus qhia:
1. BMP sensors ua rau cua, cua sov thiab teeb pom kev zoo. Nco ntsoov npog nws, cov txiaj ntsig zoo tshaj plaws tau ua tiav los ntawm kev ua Npuas Ua Ntej nrog qhov cua nkag tau zoo rau nws. Tej yam zoo li daim kab xev yuav ua haujlwm ib yam tab sis yuav tsis raug.
2. BMP feem ntau siv 3.3V tshwj tsis yog koj lub chaw tsim khoom hais lwm yam. OLED yuav ua haujlwm los ntawm 3.3v-5.5V (4-5V pom zoo)
3. Teeb tsa txhua yam ntawm daim ntawv qhia zaub mov ua ntej pom zoo.
4. Yog tias koj yog tus tshiab rau OLED thov sim ua cov khoom yooj yim ua ntej xws li cov ntawv thiab dummy buffers kom paub tseeb tias koj cov zaub ua haujlwm nrog rau koj kev sib txuas raug.
Pom zoo:
Yuav Tsim Li Cas thiab Ntxig Ib Lub Rooj Thiab Ntxiv Kab Ntxiv Thiab/lossis Kab Rau Cov Lus Hauv Microsoft Office Word 2007: 11 Cov Kauj Ruam
Yuav Tsim Li Cas thiab Ntxig Cov Lus Thiab Ntxiv Kab Ntxiv Thiab/lossis Kab Rau Cov Lus Hauv Microsoft Office Word 2007: Koj puas tau muaj cov ntaub ntawv ntau uas koj ua haujlwm nrog thiab xav rau koj tus kheej … " Kuv yuav ua li cas ntawm cov ntaub ntawv no saib zoo dua thiab nkag siab yooj yim dua? " Yog tias yog, tom qab ntawd lub rooj hauv Microsoft Office Word 2007 yuav yog koj cov lus teb
Yuav Siv Neopixel Ws2812 LED lossis LED Sawb lossis Led Ring Nrog Arduino: 4 Kauj Ruam
Yuav Siv Neopixel Ws2812 LED lossis LED Sawb lossis Led Ring Nrog Arduino: Nyob zoo cov menyuam txij li Neopixel coj Sawb tau nrov heev thiab nws tseem hu ua ws2812 coj sawb ib yam. Lawv yog cov neeg nyiam heev vim tias hauv cov kab coj no peb tuaj yeem hais qhia txhua tus thiab txhua tus coj sib cais uas txhais tau tias yog koj xav tau ob peb lub leds kom ci hauv ib xim
I2C / IIC LCD Zaub - Siv SPI LCD rau I2C LCD Zaub Siv SPI rau IIC Module Nrog Arduino: 5 Kauj Ruam
I2C / IIC LCD Zaub | Siv SPI LCD rau I2C LCD Zaub Siv SPI rau IIC Module Nrog Arduino: Nyob zoo cov phooj ywg txij li ib txwm muaj SPI LCD 1602 muaj xov tooj ntau dhau los txuas yog li nws nyuaj rau cuam tshuam nrog arduino tab sis muaj ib qho qauv muaj nyob hauv khw uas tuaj yeem hloov SPI zaub rau hauv IIC zaub yog li ntawd koj yuav tsum txuas tsuas yog 4 xov hlau
Arduino Neeg Hlau Nrog Kev Nyob, Kev Qhia thiab Qib Kev Sib Hloov (Sab Hnub Poob, Sab Hnub Poob, Sab Qaum Teb, Sab Qab Teb) Tswj los ntawm Lub Suab Siv Bluetooth Module thiab Kev Siv Tus Neeg Siv Hluav Taws Xob: 6 Kauj Ruam
Arduino Neeg Hlau Nrog Kev Nyob, Kev Qhia thiab Qib Kev Sib Hloov (Sab Hnub Poob, Sab Hnub Poob, Sab Qaum Teb, Sab Qab Teb) Tswj los ntawm Lub Suab Siv Bluetooth Module thiab Kev Siv Tus Neeg Siv Hluav Taws Xob: Cov lus qhia no piav qhia yuav ua li cas thiaj tsim tau Arduino Robot uas tuaj yeem txav mus raws qhov xav tau (Forward, Backward) , Sab laug, Txoj Cai, Sab Hnub Poob, Sab Hnub Poob, Sab Qaum Teb, Sab Qab Teb) xav tau Kev nrug deb hauv Centimeters siv lub suab hais kom ua. Neeg hlau kuj tseem tuaj yeem txav tau tus kheej
8 Relay Tswj Nrog NodeMCU thiab IR Txais Txais Siv WiFi thiab IR Chaw Taws Teeb thiab Android App: 5 Kauj Ruam (nrog Duab)
8 Relay Tswj Nrog NodeMCU thiab IR Txais Txais Siv WiFi thiab IR Chaw Taws Teeb thiab Android App: Tswj 8 qhov hloov pauv hloov siv nodemcu thiab ir tus txais tshaj wifi thiab ir chaw taws teeb thiab hauv app.the ir tej thaj chaw deb ua haujlwm ywj pheej ntawm wifi txuas. NTUJ