Cov txheej txheem:

Arduino: Qhov Taw Qhia Muaj Peev Xwm Siv Led Matrix MAX7219: 4 Cov Kauj Ruam
Arduino: Qhov Taw Qhia Muaj Peev Xwm Siv Led Matrix MAX7219: 4 Cov Kauj Ruam

Video: Arduino: Qhov Taw Qhia Muaj Peev Xwm Siv Led Matrix MAX7219: 4 Cov Kauj Ruam

Video: Arduino: Qhov Taw Qhia Muaj Peev Xwm Siv Led Matrix MAX7219: 4 Cov Kauj Ruam
Video: HMONG World Mosquito Destroyer 2024, Kaum ib hlis
Anonim
Arduino: Qhov Taw Qhia Muaj Peev Xwm Siv Led Matrix MAX7219
Arduino: Qhov Taw Qhia Muaj Peev Xwm Siv Led Matrix MAX7219

Hauv qhov kev qhia yav dhau los Kuv tau ua lub zog ntsuas qhov ntsuas siv lub nplhaib RGB neo pixels coj. koj tuaj yeem pom nws hauv kab lus no "Potentio Qhov Taw Qhia Siv RGB Neopixel"

Thiab hnub no kuv yuav qhia lub hwj chim qhia tau siv MAX7219 coj cov ntsuas ntsuas ntsuas.

Ua raws cov theem hauv qab no kom ua tau.

Kauj Ruam 1: Cov Cheeb Tsam Xav Tau

Yuav tsum tau Cheebtsam
Yuav tsum tau Cheebtsam
Yuav tsum tau Cheebtsam
Yuav tsum tau Cheebtsam
Yuav tsum tau Cheebtsam
Yuav tsum tau Cheebtsam

Yam Yuav Tsum Tau Ua:

  • Arduino nano cov
  • Potentiometer
  • Max7219 Led Matrix Zaub
  • Jumper Hlau
  • Pawg Thawj Coj
  • USB mini tso
  • laptop

Yuav tsum muaj tsev qiv ntawv

LedControl

Kauj ruam 2: Scheme

Txheej txheem
Txheej txheem
Txheej txheem
Txheej txheem
Txheej txheem
Txheej txheem

Txhawm rau sib sau ua ke pom cov duab kos duab saum toj no, koj tuaj yeem pom cov ntaub ntawv hauv qab no:

Arduino rau Led & hwj chim

+5V ==> VCC & 3. Potentio

GND ==> GND & 1. Penentio

D6 ==> Cov ntaub ntawv hauv

D7 ==> CLK

D8 ==> CS / Thauj khoom

Kauj ruam 3: Programming

Programming
Programming

Siv cov cai hauv qab no los ua ait:

#suav nrog "LedControl.h"

/*

Tam sim no peb xav tau LedControl los ua haujlwm nrog. ***** Cov lej tus lej no tej zaum yuav tsis ua haujlwm nrog koj lub khoos phis tawj ***** tus pin 6 txuas nrog rau DataIn tus pin 7 txuas nrog CLK tus pin 8 txuas nrog LOAD Peb tsuas muaj ib qho MAX72XX nkaus xwb. */

LedControl lc = LedControl (6, 7, 8, 1);

unsigned ntev ncua sijhawm = 100;

void teeb tsa () {

lc.shutdown (0, tsis tseeb); lc.setIntensity (0, 8); lc.clearDisplay (0); } void loop () {int val = analogRead (A0); val = daim ntawv qhia (val, 0, 1023, 0, 8);

yog (val == 1)

{

lc.setRow (0, 0, B10000000);

}

yog (val == 2)

{lc.setRow (0, 0, B10000000); lc.setRow (0, 1, B10000000); } yog (val == 3) {

lc.setRow (0, 0, B10000000);

lc.setRow (0, 1, B10000000); lc.setRow (0, 2, B10000000); } yog (val == 4) {

lc.setRow (0, 0, B10000000);

lc.setRow (0, 1, B10000000); lc.setRow (0, 2, B10000000); lc.setRow (0, 3, B10000000); } yog (val == 5) {

lc.setRow (0, 0, B10000000);

lc.setRow (0, 1, B10000000); lc.setRow (0, 2, B10000000); lc.setRow (0, 3, B10000000); lc.setRow (0, 4, B10000000); } yog (val == 6) {lc.setRow (0, 0, B10000000); lc.setRow (0, 1, B10000000); lc.setRow (0, 2, B10000000); lc.setRow (0, 3, B10000000); lc.setRow (0, 4, B10000000); lc.setRow (0, 5, B10000000); } yog (val == 7) {lc.setRow (0, 0, B10000000); lc.setRow (0, 1, B10000000); lc.setRow (0, 2, B10000000); lc.setRow (0, 3, B10000000); lc.setRow (0, 4, B10000000); lc.setRow (0, 5, B10000000); lc.setRow (0, 6, B10000000); } yog (val == 8) {lc.setRow (0, 0, B10000000); lc.setRow (0, 1, B10000000); lc.setRow (0, 2, B10000000); lc.setRow (0, 3, B10000000); lc.setRow (0, 4, B10000000); lc.setRow (0, 5, B10000000); lc.setRow (0, 6, B10000000); lc.setRow (0, 7, B10000000); } lc.clearDisplay (0); }

Kauj Ruam 4: Qhov tshwm sim

Thaum programmed, cov txiaj ntsig yuav zoo li no.

Yog tias lub hwj chim tau tig mus rau sab xis, cov nyob LEDs yuav nce raws tus naj npawb ntawm tig.

Yog tias lub lauj kaub tau tig mus rau sab laug, LED nyob yuav tsawg dua thiab tsawg dua tom qab lub zog hloov pauv.

Pom zoo: