Cov txheej txheem:

Txoj hauv kev yooj yim Super los tswj Servo Tsav Nrog Arduino: 8 Cov Kauj Ruam
Txoj hauv kev yooj yim Super los tswj Servo Tsav Nrog Arduino: 8 Cov Kauj Ruam

Video: Txoj hauv kev yooj yim Super los tswj Servo Tsav Nrog Arduino: 8 Cov Kauj Ruam

Video: Txoj hauv kev yooj yim Super los tswj Servo Tsav Nrog Arduino: 8 Cov Kauj Ruam
Video: Технический разговор TUDev с профессором Борой Озкан - Финтех и будущее финансов 2024, Kaum ib hlis
Anonim
Txoj Kev Yooj Yim Yooj Yim los Tswj Servo Tsav Nrog Arduino
Txoj Kev Yooj Yim Yooj Yim los Tswj Servo Tsav Nrog Arduino

Hauv qhov kev qhia no peb yuav siv Servo Motor thiab Arduino UNO, thiab Visuino los tswj cov haujlwm servo motor degree siv tsuas yog ob peb yam thiaj li ua txoj haujlwm no yooj yim heev.

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
Koj Yuav Tsum Tau Dab Tsi
Koj Yuav Tsum Tau Dab Tsi
Koj Yuav Tsum Tau Dab Tsi
Koj Yuav Tsum Tau Dab Tsi
  1. Arduino UNO (lossis lwm yam Arduino)
  2. Jumper xov hlau
  3. Servo tsav
  4. Visuino program: Rub tawm Visuino

Kauj ruam 2: Circuit Court

Qhov Circuit
Qhov Circuit
Qhov Circuit
Qhov Circuit
  1. Txuas Servo motor "Txiv kab ntxwv" tus pin rau Arduino Digital tus pin [8]
  2. Txuas Servo motor "Liab" tus pin rau Arduino tus pin zoo [5V]
  3. Txuas Servo motor "Brown" tus pin rau Arduino tus pin tsis zoo [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 Cheebtsam

Hauv Visuino Ntxiv Cheebtsam
Hauv Visuino Ntxiv Cheebtsam
  1. Ntxiv "Sequence" tivthaiv
  2. Ntxiv "Analog Value" tivthaiv
  3. Ntxiv "Faib Analog Los Ntawm Tus Nqi" tivthaiv
  4. Ntxiv "Servo" tivthaiv

Kauj Ruam 5: Hauv Visuino Teeb Cov Khoom

Hauv Visuino Teeb Cov Txheej Txheem
Hauv Visuino Teeb Cov Txheej Txheem
Hauv Visuino Teeb Cov Txheej Txheem
Hauv Visuino Teeb Cov Txheej Txheem

Xaiv "Sequence1" tivthaiv, ob npaug nias rau nws. Hauv "Elements" Dialog:

Luag 5X "Lub Sijhawm" lub ntsiab lus rau sab laug.

  1. Xaiv "Lub Sijhawm 1" lub ntsiab lus thiab hauv qab qhov khoom tsim teeb tsa "Ncua" rau "1000"
  2. Xaiv "Lub Sijhawm 2" ntu thiab hauv qab qhov khoom tsim teeb tsa "Ncua" rau "2000"
  3. Xaiv "Lub Sijhawm 3" ntu thiab hauv qab qhov khoom tsim teeb tsa "Ncua" rau "3000"
  4. Xaiv "Lub Sijhawm 4" ntu thiab hauv qab qhov khoom tsim teeb tsa "Ncua" rau "4000"
  5. Xaiv "Lub Sijhawm 5" lub ntsiab lus thiab hauv cov khoom qhov rai teeb tsa "Ncua" mus rau "5000" >> qhov no yuav siv rau ncua sijhawm kawg.

Tam sim no cia teeb Qib rau servo motor: Xaiv "AnalogValue1" tivthaiv, ob npaug nias rau nws. Hauv "Elements" Dialog:

Luag 4X "Teeb Tus Nqi" keeb rau sab laug.

  1. Xaiv "Teeb Tus Nqi 1" tivthaiv thiab hauv qab lub qhov rai khoom teeb tsa "Tus nqi" rau "0"
  2. Xaiv "Teeb Tus Nqi 2" tivthaiv thiab hauv qab qhov khoom qhov rai teeb tsa "Tus nqi" rau "60"
  3. Xaiv "Teeb Tus Nqi 3" tivthaiv thiab hauv qab lub qhov rai khoom teeb tsa "Tus nqi" rau "120"
  4. Xaiv "Teeb Tus Nqi 4" tivthaiv thiab hauv qab qhov khoom qhov rai teeb tsa "Tus nqi" rau "180"

Xaiv "DivideByValue1" tivthaiv thiab hauv cov khoom qhov rai teeb tsa "tus nqi" rau "180"

Kauj Ruam 6: Hauv Visuino Connect Components

Hauv Visuino Connect Components
Hauv Visuino Connect Components
  • Txuas "Sequence1"> Period1 tus pin [Tawm] rau "AnalogValue1" tus pin [Teeb Tus Nqi 1]
  • Txuas "Sequence2"> Period1 tus pin [Tawm] mus rau "AnalogValue1" tus pin [Teeb Tus Nqi 2]
  • Txuas "Sequence3"> Period1 tus pin [Tawm] mus rau "AnalogValue1" tus pin [Teeb Tus Nqi 3]
  • Txuas "Sequence4"> Period1 tus pin [Tawm] mus rau "AnalogValue1" tus pin [Teeb Tus Nqi 4]
  • Txuas "AnalogValue1" tus pin [Tawm] rau "DivideByValue1" tus pin [Hauv]
  • Txuas "DivideByValue1" tus pin [Tawm] rau "Servo1" tus pin [Hauv]
  • Txuas "Servo1" tus pin [Tawm] rau Arduino tus lej digital [8]

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

Yog tias koj siv zog Arduino UNO module, Servo lub cev muaj zog yuav pib txav mus raws qib koj tau teev tseg.

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 qhov Qhia Qhia no. Koj tuaj yeem rub tawm thiab qhib nws hauv Visuino:

Pom zoo: