Cov txheej txheem:

Yuav Ua Li Cas Saib Xyuas Cov Tsob Ntoo Nrog Arduino: 7 Kauj Ruam
Yuav Ua Li Cas Saib Xyuas Cov Tsob Ntoo Nrog Arduino: 7 Kauj Ruam

Video: Yuav Ua Li Cas Saib Xyuas Cov Tsob Ntoo Nrog Arduino: 7 Kauj Ruam

Video: Yuav Ua Li Cas Saib Xyuas Cov Tsob Ntoo Nrog Arduino: 7 Kauj Ruam
Video: Saib Mis paub Poj niam (hluas nkauj) tus yam ntxwv lub siab 2024, Hlis ntuj nqeg
Anonim

Hauv qhov kev qhia no peb yuav kawm paub yuav txheeb xyuas cov av noo li cas siv lub ntsuas dej noo thiab nyem lub teeb ntsuab yog tias txhua yam ua tau zoo thiab OLED Zaub thiab Visuino.

Saib cov yees duab.

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
Koj Yuav Tsum Tau Dab Tsi
Koj Yuav Tsum Tau Dab Tsi

Arduino UNO (lossis lwm yam Arduino) Tau nws ntawm no

Av noo noo sensor module, Tau nws ntawm no

Jumper xov hlau

Breadboard Tau nws ntawm no

OLED Zaub Tau nws ntawm no

1X Liab LED, 1X Ntsuab LED Tau lawv ntawm no

Visuino program: Rub tawm Visuino

Kauj ruam 2: Circuit Court

Qhov Circuit
Qhov Circuit
  • Txuas OLED Display pin [VCC] rau Arduino tus pin [5V]
  • Txuas OLED Display pin [GND] rau Arduino tus pin [GND]
  • Txuas OLED Display pin [SDA] rau Arduino tus pin [SDA]
  • Txuas OLED Display pin [SCL] rau Arduino tus pin [SCL]
  • Txuas Arduino 5V rau piezo buzzer module tus pin VCC
  • Txuas Arduino GND rau Ntsuab LED tsis zoo Pin
  • Txuas Arduino GND rau Liab LED tsis zoo Pin
  • Txuas Arduino Digital Pin 3 rau Ntsuab LED tsis zoo Pin
  • Txuas Arduino Digital Pin 2 rau Liab LED tsis zoo Pin
  • Txuas Arduino 5V mus rau qhov ntsuas qhov ntsuas qhov ntsuas tus pin VCC
  • Txuas Arduino GND mus rau qhov ntsuas qhov ntsuas qhov ntsuas tus pin GND
  • Txuas Arduino analog pin 0 mus rau qhov ntsuas qhov ntsuas qhov ntsuas tus lej A0

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

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

Txhawm rau pib ua haujlwm rau Arduino, koj yuav tsum muaj Arduino IDE teeb tsa los ntawm no:

Thov nco ntsoov tias muaj qee qhov teeb meem tseem ceeb hauv Arduino IDE 1.6.6. Nco ntsoov tias koj nruab 1.6.7 lossis siab dua, txwv tsis pub Cov Lus Qhia no yuav tsis ua haujlwm! Yog tias koj tsis tau ua raws cov kauj ruam hauv Phau Ntawv Qhia no teeb tsa Arduino IDE rau program Arduino UNO! Visuino: https://www.visuino.eu tseem yuav tsum tau teeb tsa. 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 UNO" raws li qhia hauv daim duab 2

Kauj Ruam 4: Hauv Visuino ADD thiab Teeb Khoom

Hauv Visuino ADD thiab Teeb Khoom
Hauv Visuino ADD thiab Teeb Khoom
Hauv Visuino ADD thiab Teeb Khoom
Hauv Visuino ADD thiab Teeb Khoom
Hauv Visuino ADD thiab Teeb Khoom
Hauv Visuino ADD thiab Teeb Khoom

Ntxiv "OLED Display" tivthaiv

Ntxiv 2X "Sib piv Tus Nqi Analog" tivthaiv

  • Ob npaug nias rau ntawm DisplayOLED1 thiab hauv cov ntsiab lus qhov rai rub Cov Lus Teb mus rau sab laug, tom qab ntawd hauv cov khoom vaj khoom tsev teeb tsa qhov loj me rau 3 Kaw lub ntsiab qhov rai
  • Xaiv CompareValue1 thiab hauv cov khoom vaj huam sib luag teeb tsa "Sib piv Hom" rau ctBiggerOrEqual thiab Tus Nqi rau 0.7 << qhov no yog tus nqi rhiab heev, koj tuaj yeem hloov nws yog tias koj xav tau
  • Xaiv CompareValue2 thiab hauv cov khoom vaj huam sib luag teeb tsa "Sib piv Hom" rau ctSmaller thiab Tus Nqi rau 0.7 << qhov no yog tus nqi rhiab heev, koj tuaj yeem hloov nws yog tias koj xav tau

Kauj Ruam 5: Hauv Visuino Connect Components

Hauv Visuino Connect Components
Hauv Visuino Connect Components
  • Txuas Arduino analog pin 0 rau CompareValue1 tus pin Hauv, Sib PivValue2 tus pin Hauv, DisplayOLED1> Cov Ntawv Teb 1 Tus Pin
  • Txuas Sib PivValue1 Pin Tawm rau Arduino tus lej digital 2
  • Txuas Txuas Sib Piv 2 Tus Nqi Tawm rau Arduino tus lej digital 3
  • DisplayOLED1 tus pin I2C Tawm rau Arduino board I2C tus pin Hauv

Kauj Ruam 6: 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 7: Ua si

Yog tias koj ua lub zog Arduino UNO module, thiab LED yuav tsum nyem (liab tsis txaus dej, dej ntsuab txaus) thiab OLED Zaub yuav qhia txog qib dej noo Zoo siab! Koj tau ua tiav koj txoj haujlwm nrog Visuino. Kuj txuas nrog yog Visuino project, uas kuv tau tsim rau Cov Lus Qhia no, koj tuaj yeem rub tawm nws ntawm no thiab qhib nws hauv Visuino:

Pom zoo: