Cov txheej txheem:

Qhov Ntsuas Qhov Ntsuas Neopixel Ws2812 LED Nplhaib & Arduino: 8 Kauj Ruam
Qhov Ntsuas Qhov Ntsuas Neopixel Ws2812 LED Nplhaib & Arduino: 8 Kauj Ruam

Video: Qhov Ntsuas Qhov Ntsuas Neopixel Ws2812 LED Nplhaib & Arduino: 8 Kauj Ruam

Video: Qhov Ntsuas Qhov Ntsuas Neopixel Ws2812 LED Nplhaib & Arduino: 8 Kauj Ruam
Video: Yasmi - Txiv Nraug Ntsuag ft. JN Vang (Music Video) 2024, Hlis ntuj nqeg
Anonim

Hauv qhov kev qhia no peb yuav kawm paub yuav Ua Li Cas Volume Indicator siv Neopixel Ws2812 LED Ring thiab arduino.

Saib Video!

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 lub Rooj Tswjhwm Saib Arduino
  • NeoPixel - RGB LED Nplhaib
  • Jumper xov hlau
  • Potentiometer
  • Visuino software: Rub tawm ntawm no

Kauj ruam 2: Circuit Court

Qhov Circuit
Qhov Circuit
  • Txuas Arduino board tus pin 5V rau LedRing tus pin VCC
  • Txuas Arduino board tus pin GND rau LedRing tus pin GND
  • Txuas Arduino board Digital tus pin 2 rau LedRing tus pin DI
  • Txuas potentiometer tus pin OTB rau Arduino Analog Pin A0
  • Txuas potentiometer tus pin VCC rau Arduino Analog Pin 5V
  • Txuas tus potentiometer tus pin GND rau Arduino 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

Visuino: https://www.visuino.eu tseem yuav tsum tau teeb tsa. Rub tawm Dawb version lossis sau npe rau Kev Sim Dawb.

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
Hauv Visuino Ntxiv Cheebtsam
Hauv Visuino Ntxiv Cheebtsam
  • Ntxiv "Daim Ntawv Qhia Ntau Yam Analog" tivthaiv
  • Ntxiv "Ramp To Analog Value" tivthaiv
  • Ntxiv "Analog To Unsigned" tivthaiv
  • Ntxiv 2X "Sib piv Tus Nqi Analog" tivthaiv
  • Ntxiv 2X "Tus Nqi Xim" tivthaiv
  • Ntxiv "RGBW Xim Multi-Source Merger" tivthaiv
  • 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
  • Xaiv "MapRange1" thiab hauv cov khoom teeb tsa Kev Tawm Tswv Yim> Max mus rau 1, thiab Kev Tawm Tswv Yim Ntau> Min rau 0
  • Xaiv "MapRange1" thiab hauv cov khoom teeb tsa Cov Khoom Ntau Yam> Max rau 12, thiab Cov Zis Tawm> Min rau 0

Nco tseg: Qhov Ntau Tshaj Tawm> Max rau 12 yog tus lej ntawm LED ntawm LEDRing

  • Xaiv "RampToValue1" thiab hauv cov khoom qhov rai teeb tsa nqes hav (S) txog 1000
  • Xaiv "CompareValue1" thiab hauv cov khoom vaj huam sib luag teeb tsa Hom Sib piv rau ctBigger thiab Tus Nqi rau 10 thiab tseem xaiv Tus Nqi Teb thiab nyem rau ntawm Pin Icon thiab xaiv "Float Sink Pin"
  • Xaiv "CompareValue2" thiab hauv cov khoom vaj huam sib luag teeb tsa Hom Sib piv rau ctSmaller kuj xaiv Tus Nqi Teb thiab nyem rau ntawm tus Pin Pin thiab xaiv "Float Sink Pin"
  • Xaiv "ColorValue2" thiab hauv cov khoom qhov rai teeb tsa Tus nqi rau clNavy
  • Ob npaug nias rau ntawm "NeoPixels1" thiab hauv PixelGroups lub qhov rais rub ColorPixel mus rau sab laug, thiab hauv lub qhov rai khoom tom qab teeb tsa suav Pixels rau 12

Nco tseg: Suav Pixels 12 yog tus lej ntawm LED ntawm LEDRing

Kauj Ruam 6: Hauv Visuino Connect Components

Hauv Visuino Connect Components
Hauv Visuino Connect Components
Hauv Visuino Connect Components
Hauv Visuino Connect Components
  • Txuas Arduino Analog tus pin [0] Tawm rau MapRange1 tus pin Hauv
  • Txuas "MapRange1" tus pin Tawm rau RampToValue1 tus pin Hauv, thiab Sib PivValue1 tus lej Tus Nqi thiab Sib PivValue2 tus lej Tus Nqi
  • Txuas "RampToValue1" tus pin tawm mus rau CompareValue1 tus pin hauv thiab CompareValue2 tus pin hauv thiab AnalogToUnsigned1 tus pin
  • Txuas AnalogToUnsigned1 tus pin tawm rau NeoPixels1 tus lej Index
  • Txuas Txuas Sib Piv 1 Tus Nqi Tawm rau ColorValue1 tus pin moos
  • Txuas Txuas Sib Piv 2 Tus Nqi Tawm rau ColorValue2 tus pin moos
  • Txuas ColorValue1 tus pin Tawm rau RGBWColorMultiMerger1 tus pin [0]
  • Txuas ColorValue2 tus pin Tawm rau RGBWColorMultiMerger1 tus pin [1]
  • Txuas RGBWColorMultiMerger1 tus pin tawm rau NeoPixels1 tus pin Xim
  • Txuas NeoPixels1 tus pin tawm mus rau Arduino Digital Pin 2

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 tus qauv, thiab swb lub zog potentiometer lub Nplhaib LED yuav qhia txog Potentiometer txoj haujlwm. Koj tuaj yeem siv txoj hauv kev no hauv Cov Ntawv Thov Suab qhov twg koj xav tau los qhia qhov ntim haujlwm lossis lwm qhov haujlwm uas qee qhov kev ntsuas pom tau xav tau.

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: