Cov txheej txheem:

Arduino Txuas Ntau I2C Devices: 6 Cov Kauj Ruam
Arduino Txuas Ntau I2C Devices: 6 Cov Kauj Ruam

Video: Arduino Txuas Ntau I2C Devices: 6 Cov Kauj Ruam

Video: Arduino Txuas Ntau I2C Devices: 6 Cov Kauj Ruam
Video: I2C LCD display with Arduino: Easy Tutorial! 2024, Kaum ib hlis
Anonim

Hauv qhov kev qhia no peb yuav kawm paub yuav txuas ntau lub modules nrog I2C kev txuas mus rau arduino li cas.

Saib Video!

Hauv peb qhov xwm txheej peb yuav siv 4 OLED Cov Lus Qhia ua piv txwv, tab sis koj tuaj yeem siv lwm yam I2C modules/sensors yog tias koj xav tau.

Nco tseg: 4 OLED Cov Lus Qhia siv lub cim xeeb me ntsis ntxiv uas yog vim li cas peb thiaj siv Arduino Mega los tswj qhov no vim Arduino UNO nco tau qis dua. Xaiv koj Arduino, ESP, thiab lwm yam pawg thawj coj raws li koj lub cim xeeb/cov qauv kev nco nco.

Kauj ruam 1: Yam Koj Yuav Tsum Tau

Koj Yuav Tsum Tau Dab Tsi
Koj Yuav Tsum Tau Dab Tsi
Koj Yuav Tsum Tau Dab Tsi
Koj Yuav Tsum Tau Dab Tsi
Koj Yuav Tsum Tau Dab Tsi
Koj Yuav Tsum Tau Dab Tsi
  • Arduino Mega 2560 lossis lwm yam Arduino boardNote: Peb tab tom siv Arduino Mega hauv qhov no vim tias OLED Cov Lus Qhia tau siv ntau lub cim xeeb thiab Aruino UNO yuav tsis tuaj yeem daws qhov ntawd. Yog li xaiv koj pawg thawj coj raws li koj cov qauv.
  • 8-Channel I2C module TCA9548A
  • 4 OLED Cov Lus Qhia (lossis ib tus lej ntawm lwm I2C cov qauv)
  • Cov qhob cij
  • Jumper xov hlau
  • Visuino software: Rub tawm ntawm no

Kauj ruam 2: Circuit Court

Qhov Circuit
Qhov Circuit
  • Txuas TCA9548A tus pin SDA rau Arduino tus pin SDA
  • Txuas TCA9548A tus pin SCL rau Arduino tus pin SCL
  • Txuas TCA9548A tus pin VIN rau Arduino tus pin 5V
  • Txuas TCA9548A tus pin GND rau Arduino tus pin GND
  • Txuas OLED Display1 tus pin VCC rau Arduino tus pin 5V
  • Txuas OLED Display1 tus pin GND rau Arduino tus pin GND
  • Txuas OLED Display1 tus pin SDA rau TCA9548A tus pin SD0
  • Txuas OLED Display1 tus pin SCL rau TCA9548A tus pin SC0
  • Txuas OLED Display2 tus pin VCC rau Arduino tus pin 5V
  • Txuas OLED Display2 tus pin GND rau Arduino tus pin GND
  • Txuas OLED Display2 tus pin SDA rau TCA9548A tus pin SD1
  • Txuas OLED Display2 tus pin SCL rau TCA9548A tus pin SC1
  • Txuas OLED Display3 tus pin VCC rau Arduino tus pin 5V
  • Txuas OLED Display3 tus pin GND rau Arduino tus pin GND
  • Txuas OLED Display3 tus pin SDA rau TCA9548A tus pin SD2
  • Txuas OLED Display3 tus pin SCL rau TCA9548A tus pin SC2
  • Txuas OLED Display4 tus pin VCC rau Arduino tus pin 5V
  • Txuas OLED Display4 tus pin GND rau Arduino tus pin GND
  • Txuas OLED Display4 tus pin SDA rau TCA9548A tus pin SD3
  • Txuas OLED Display4 tus pin SCL rau TCA9548A tus pin SC3

Kauj Ruam 3: Pib Visuino, thiab Xaiv Arduino MEGA Board Type

Pib Visuino, thiab Xaiv Arduino MEGA Board Type
Pib Visuino, thiab Xaiv Arduino MEGA Board Type
Pib Visuino, thiab Xaiv Arduino MEGA Board Type
Pib Visuino, thiab Xaiv Arduino MEGA Board Type

Visuino: https://www.visuino.eu tseem yuav tsum tau teeb tsa. Rub tawm Dawb version lossis sau npe rau Kev Sim Dawb.

Pib Visuino raws li pom hauv thawj daim duab Nyem rau ntawm "Cov cuab yeej" khawm ntawm Arduino tivthaiv (Daim duab 1) hauv Visuino Thaum qhov kev sib tham tshwm, xaiv "Arduino Mega 2560" raws li qhia hauv daim duab 2

Kauj Ruam 4: Hauv Visuino Ntxiv, Teeb & Txuas Cheeb Tsam

Hauv Visuino Ntxiv, Teeb & Txuas Cheeb Tsam
Hauv Visuino Ntxiv, Teeb & Txuas Cheeb Tsam
Hauv Visuino Ntxiv, Teeb & Txuas Cheeb Tsam
Hauv Visuino Ntxiv, Teeb & Txuas Cheeb Tsam
Hauv Visuino Ntxiv, Teeb & Txuas Cheeb Tsam
Hauv Visuino Ntxiv, Teeb & Txuas Cheeb Tsam
  • Ntxiv TCA9548A tivthaiv
  • Ntxiv 4x OLED Display Cheebtsam

Kauj ruam 1:

  • Xaiv txhua qhov oled Display tivthaiv thiab hauv cov khoom qhov rai teeb tsa dav, qhov siab, hom zaub
  • Ob npaug nias rau ntawm "DisplayOLED1" tivthaiv thiab hauv Elements, luag "Kos Cov Ntawv" mus rau sab laug
  • Hauv cov khoom vaj huam sib luag teeb tsa me me rau 3, ntawv rau OLED1
  • Kaw lub Elements window.

Rov Ua Dua Steap1 rau lwm cov khoom siv

Kev sib txuas:

Txuas "DisplayOLED1" tus pin I2C Tawm rau "I2CSwitch1"> I2C 0

Txuas "DisplayOLED2" tus pin I2C Tawm rau "I2CSwitch1"> I2C 1

Txuas "DisplayOLED2" tus pin I2C Tawm rau "I2CSwitch1"> I2C 2

Txuas "DisplayOLED3" tus pin I2C Tawm rau "I2CSwitch1"> I2C 3

Nco tseg: Yog tias koj siv lwm tus qauv/ntsuas ntsuas ib yam thiab tom qab ntawd tsuas yog txuas lawv I2C tus pin tib yam nkaus.

Kauj Ruam 5: Tsim, Ua Ke, thiab Tshaj Tawm Arduino Code

Tsim, Sau, thiab Tso Tawm Arduino Code
Tsim, Sau, thiab Tso Tawm Arduino Code

Hauv Visuino, hauv qab nyem rau ntawm "Tsim" Tab, xyuas kom tseeb tias qhov chaw nres nkoj raug xaiv, tom qab ntawd nyem rau ntawm "Compile/Build and Upload" khawm.

Kauj ruam 6: Ua si

Yog tias koj ua lub zog Arduino module, OLED Cov Lus Qhia yuav pib qhia cov ntawv.

Nrog koj zoo siab! Koj tau ua tiav koj txoj haujlwm nrog Visuino. Kuj txuas nrog yog Visuino qhov haujlwm, uas kuv tau tsim rau Cov Lus Qhia no, koj tuaj yeem rub nws thiab qhib nws hauv Visuino:

Pom zoo: