Cov txheej txheem:

Arduino Neopixel LED Nplhaib Ws2812 - Visuino Tutorial: 8 Kauj Ruam
Arduino Neopixel LED Nplhaib Ws2812 - Visuino Tutorial: 8 Kauj Ruam

Video: Arduino Neopixel LED Nplhaib Ws2812 - Visuino Tutorial: 8 Kauj Ruam

Video: Arduino Neopixel LED Nplhaib Ws2812 - Visuino Tutorial: 8 Kauj Ruam
Video: D009 - NeoPixel Stick - 8 x WS2812 (5050RGB) 2024, Hlis ntuj nqeg
Anonim
Image
Image

Hauv qhov kev qhia no peb yuav kawm paub yuav ua li cas thiaj tswj tau Neopixel Led Ring Ws2812 siv Arduino thiab Visuino kom khiav LED pixel ib puag ncig.

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
  • Arduino UNO (lossis lwm yam Arduino)
  • Neopixel LED nplhaib
  • Jumper xov hlau
  • Visuino program: Rub tawm Visuino

Kauj ruam 2: Circuit Court

Qhov Circuit
Qhov Circuit
  1. Txuas LED Ntiv Nplhaib [VCC] rau Arduino tus pin [+5V]
  2. Txuas LED Ntiv Nplhaib [GND] rau Arduino tus pin [GND]
  3. Txuas LED Ntiv Nplhaib [IN] lossis (DI) rau Arduino tus pin [6]

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
Hauv Visuino Ntxiv Cheebtsam
Hauv Visuino Ntxiv Cheebtsam
Hauv Visuino Ntxiv Cheebtsam
Hauv Visuino Ntxiv Cheebtsam
  1. Ntxiv "Clock Generator" tivthaiv
  2. Ntxiv "Counter" tivthaiv
  3. Ntxiv "Sib Piv Tus Nqi" tivthaiv
  4. Ntxiv "Random RGBW Xim" tivthaiv
  5. Ntxiv "NeoPixels" 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
Hauv Visuino Teeb Cov Txheej Txheem
Hauv Visuino Teeb Cov Txheej Txheem
Hauv Visuino Teeb Cov Txheej Txheem
Hauv Visuino Teeb Cov Txheej Txheem
  1. Xaiv "ClockGenerator1" tivthaiv thiab hauv cov khoom qhov rai teeb tsa "Zaus" rau 10
  2. Xaiv "Counter1" tivthaiv thiab hauv cov khoom qhov rai teeb tsa "Max" txog 12 lossis 16 (Nyob ntawm seb muaj pes tsawg LED koj lub nplhaib LED muaj)
  3. Xaiv "Counter1" tivthaiv thiab hauv cov khoom qhov rai teeb tsa "Min" rau 0
  4. Xaiv "CompareValue1" tivthaiv thiab teeb "Tus nqi" rau 12 lossis 16 (Nyob ntawm seb muaj pes tsawg LED koj lub nplhaib LED muaj)
  5. Xaiv "CompareValue1" tivthaiv thiab teeb tsa "Sib Piv Hom" rau ctNotEqual
  6. Ob npaug nias rau ntawm "NeoPixels1" thiab hauv "PixelGroups" qhov rai luag "Xim Pixel" mus rau sab laug
  7. Ntawm sab laug ntawm "PixelGroups" lub qhov rai tom qab ntawv xaiv "Xim Pixel1" thiab hauv cov khoom qhov rai teeb tsa "Suav Pixels" txog 12 lossis 16 (Nyob ntawm seb muaj pes tsawg LED koj lub nplhaib LED muaj)

Kauj Ruam 6: Hauv Visuino Connect Components

Hauv Visuino Connect Components
Hauv Visuino Connect Components
  1. Txuas "ClockGenerator1" tiv thaiv tus pin [Tawm] rau "Counter1" tiv thaiv tus pin [Hauv]
  2. Txuas "Counter1" tiv thaiv tus pin [Tawm] rau "CompareValue1" tiv thaiv tus pin [Hauv]
  3. Txuas "Counter1" tiv thaiv tus pin [Tawm] rau "NeoPixels1"> Xim Pixel1 tiv thaiv tus pin [Index]
  4. Txuas "CompareValue1" tiv thaiv tus pin [Tawm] rau "Counter1" tiv thaiv tus pin "Pib dua"
  5. Txuas "CompareValue1" tiv thaiv tus pin [Tawm] rau "RandomRGBWColor1" tiv thaiv tus pin "Clock"
  6. Txuas "RandomRGBWColor1" tiv thaiv tus pin [Tawm] rau "NeoPixels1"> Xim Pixel1 tiv thaiv tus pin [Xim]
  7. Txuas "NeoPixels1" tiv thaiv tus pin [Tawm] rau Arduino tus lej digital [6]

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

Yog tias koj siv zog Arduino UNO module, lub nplhaib LED yuav pib hloov nws cov xim.

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: