Cov txheej txheem:

Yuav Ua Li Cas Txhim Kho Cov Dej Tsob Ntoo Siv Arduino: 7 Kauj Ruam
Yuav Ua Li Cas Txhim Kho Cov Dej Tsob Ntoo Siv Arduino: 7 Kauj Ruam

Video: Yuav Ua Li Cas Txhim Kho Cov Dej Tsob Ntoo Siv Arduino: 7 Kauj Ruam

Video: Yuav Ua Li Cas Txhim Kho Cov Dej Tsob Ntoo Siv Arduino: 7 Kauj Ruam
Video: Tshuaj theem vim li cas thiaj tau nqi ?/ Siv kho mob dab tsi?/paris polyphylla использовать для? 2024, Hlis ntuj nqeg
Anonim

Hauv qhov kev qhia no peb yuav kawm paub yuav ua li cas thiaj li ua kom tsob ntoo ywg dej

Siv lub ntsuas dej noo, lub twj tso kua dej thiab nyem lub LED 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
  • 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
  • Lub twj tso kua dej Tau nws ntawm no
  • Relay 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
  • Txuas Relay VCC tus pin (+) rau Arduino 5V tus pin
  • Txuas Relay GND tus pin (-) rau Arduino GND tus pin
  • Txuas Relay teeb liab tus pin (S) rau Arduino Digital tus pin 10
  • Txuas lub zog hluav taws xob 12V (+) los tso cov hlau liab (+)
  • Txuas lub zog hluav taws xob 12V (-) rau tus lej txuas (com)
  • Txuas lub twj tso kua mis dub (-) rau tus pin txuas (TSIS MUAJ)

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
Hauv Visuino Connect Components
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 1 Tus Nqi Tawm mus rau Arduino tus lej digital 10
  • Txuas Txuas Sib Piv 2 Tus Nqi Tawm rau Arduino tus lej digital 3
  • Txuas 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 dej tsis txaus, dej txaus txaus) thiab OLED Zaub yuav qhia txog qib dej noo, yog tias qib dej qis dhau lub twj tso kua mis yuav pib ntxiv dej.

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: