Cov txheej txheem:

SW -520D Kev co Sensor Hlau Pob Tilt Hloov - Visuino: 6 Cov Kauj Ruam
SW -520D Kev co Sensor Hlau Pob Tilt Hloov - Visuino: 6 Cov Kauj Ruam

Video: SW -520D Kev co Sensor Hlau Pob Tilt Hloov - Visuino: 6 Cov Kauj Ruam

Video: SW -520D Kev co Sensor Hlau Pob Tilt Hloov - Visuino: 6 Cov Kauj Ruam
Video: LEGO STAR WARS TCS BE WITH YOU THE FORCE MAY 2024, Kaum ib hlis
Anonim
Image
Image

Qhov SW-520D qhov yooj yim qaij hloov tuaj yeem siv tau yooj yim txhawm rau txheeb xyuas kev taw qhia. Sab hauv lub peev xwm yog lub pob uas ua rau sib cuag nrog cov pins thaum rooj plaub ncaj. Qaij cov ntaub ntawv dhau thiab cov pob tsis kov, yog li tsis ua kev sib txuas.

Lub qaij sensor tso cai rau pom kev taw qhia lossis kev nyiam. Nws kuaj pom yog tias lub ntsuas hluav taws xob ncaj ncaj lossis yog tias nws tau qaij, Hauv qhov kev qhia no, peb yuav kawm paub Tilt Sensor ua haujlwm li cas thiab yuav siv nws li cas nrog Arduino Board txhawm rau txheeb xyuas cov lus tsa suab. Peb yuav siv tus qauv piezo los ua suab nrov txhua lub sijhawm hloov pauv ua kev sib cuag.

Saib daim vis dis aus.

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

Arduino UNO (lossis lwm yam Arduino)

SW-520D Qaij Sensor

Piezo module

Liab LED

1K ohm tiv thaiv

Jumper xov hlau

Cov qhob cij

Visuino program: Rub tawm Visuino

Kauj ruam 2: Circuit Court

Qhov Circuit
Qhov Circuit
  1. Txuas Piezo module tus pin [-] rau Arduino tus pin [GND]
  2. Txuas Piezo module tus pin [+] rau Arduino tus pin [5V]
  3. Txuas Piezo module tus pin [S] rau Arduino tus pin [7]
  4. Txuas Tilt sesnsor tus pin [1] rau Arduino tus pin [5V]
  5. Txuas Tilt sesnsor tus pin [1] rau Arduino tus lej digital [8] thiab rau tus tiv thaiv.
  6. Txuas lwm sab ntawm tus tiv thaiv rau Arduino tus pin [GND]
  7. Txuas LED tus pin zoo rau Arduino tus pin [7]
  8. Txuas LED tsis zoo tus pin rau Arduino tus pin [GND]

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 Ntxiv thiab Txuas Txuas

Hauv Visuino Ntxiv thiab Txuas Txuas
Hauv Visuino Ntxiv thiab Txuas Txuas
Hauv Visuino Ntxiv thiab Txuas Txuas
Hauv Visuino Ntxiv thiab Txuas Txuas
  1. Ntxiv "Digital (Boolean) Inverter (Tsis)" tivthaiv
  2. Txuas Arduino tus pin tawm [8] rau "Inverter1" tiv thaiv tus pin [Hauv]
  3. Txuas "Inverter1" tiv thaiv tus pin [Tawm] rau Arduino Digital tus pin [7]

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
Tsim, Sau, thiab Tso Tawm Arduino Code
Tsim, Sau, thiab Tso Tawm Arduino Code

Hauv Visuino, Nias F9 lossis nyem rau ntawm lub pob uas qhia ntawm daim duab 1 los tsim Arduino code, thiab qhib Arduino IDE

Hauv Arduino IDE, nyem rau ntawm Upload khawm, txhawm rau sau thiab xa cov cai (Daim duab 2)

Kauj ruam 6: Ua si

Yog tias koj ua lub zog Arduino UNO module, thiab nias lub zog ntsuas qhov ntsuas koj yuav tsum pom tus lej hloov pauv ntawm OLED zaub thiab LED ntsuab yuav tsum pom tab sis thaum koj tsoo qhov txwv liab liab yuav tsum ci.

Nrog koj 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: