Cov txheej txheem:

Kev Tswj Tus Led Matrix Siv Arduino: 5 Cov Kauj Ruam
Kev Tswj Tus Led Matrix Siv Arduino: 5 Cov Kauj Ruam

Video: Kev Tswj Tus Led Matrix Siv Arduino: 5 Cov Kauj Ruam

Video: Kev Tswj Tus Led Matrix Siv Arduino: 5 Cov Kauj Ruam
Video: 20 MOMENTS YOU WOULDN'T BELIEVE IF NOT FILMED 2024, Kaum ib hlis
Anonim
Kev tswj hwm Led Matrix Siv Arduino
Kev tswj hwm Led Matrix Siv Arduino
Kev tswj hwm Led Matrix Siv Arduino
Kev tswj hwm Led Matrix Siv Arduino

Nyob zoo, phooj ywg.

Hauv kab lus no kuv yuav qhia koj yuav siv Led Matrix siv Arduino li cas.

Led Matrix yog sau los ntawm LEDs nyob rau hauv daim ntawv ntawm arrays. Led Matrices muaj ntau yam kab thiab kab, nyob ntawm hom. Los ntawm kev nthuav tawm ob peb LEDs nrog kev sib xyaw ua ke, Led matrix tuaj yeem tso saib tus lej cim, ntawv, cim, thiab lwm tus Lwm lub npe rau Led Matrix yog Dot Matrix.

Txoj haujlwm ua haujlwm ntawm Led Matrix zoo ib yam li "7-Segment Display" uas kuv tau tsim nag hmo. Qhov sib txawv ntawm ob yog daim ntawv ntawm qhov pom xwb.

Kauj Ruam 1: Cov Lus Qhia Tshwj Xeeb ntawm Led Matrix

Specifications ntawm Led Matrix
Specifications ntawm Led Matrix

Nov yog qhov tshwj xeeb ntawm Led Matrix:

  • Cov LEDs: 64
  • Tus naj npawb ntawm kab: 8
  • Cov nab npawb: 8
  • Ua haujlwm voltage: 4.7V - 5V DC
  • Ua Haujlwm Tam Sim No: 320mA
  • Max Ua Haujlwm Tam Sim No: 2A

Kauj Ruam 2: 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
Yuav tsum tau Cheebtsam
Yuav tsum tau Cheebtsam

Yuav tsum muaj cov khoom siv:

  • Coj Matrik
  • Arduino Nano Cov
  • Jumper Hlau
  • USBmini
  • Pawg Thawj Coj

Yuav tsum muaj tsev qiv ntawv:

LedControl

Txhawm rau ntxiv lub tsev qiv ntawv rau Arduino IDE, koj tuaj yeem pom hauv kab lus no "Ntxiv Cov Tsev Qiv Ntawv rau Arduino"

Kauj Ruam 3: Txuas Led Matrix rau Arduino IDE

Txuas Led Matrix rau Arduino IDE
Txuas Led Matrix rau Arduino IDE

Saib cov lus piav qhia hauv qab no lossis saib daim duab saum toj no:

Coj Matrix rau Arduino

VCC ==> +5V

GND ==> GND

DIN ==> D6

CS ==> D7

CLK ==> D8

Kauj ruam 4: Programming

Programming
Programming

Nov yog qhov piv txwv piv txwv uas tuaj yeem siv los sim ua tus lej matrix:

// Peb ib txwm yuav tsum suav nrog lub tsev qiv ntawv#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 8 txuas nrog CLK tus pin 7 txuas nrog LOAD Peb tsuas muaj ib qho MAX72XX nkaus xwb. */

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

/ * peb ib txwm tos me ntsis ntawm kev hloov kho tshiab ntawm cov zaub */

unsigned ntev ncua sijhawm = 100;

void teeb tsa () {

/ * MAX72XX yog nyob rau hauv hom kev txuag hluav taws xob ntawm kev pib, peb yuav tsum hu xov tooj rau sawv daws */ lc.shutdown (0, tsis tseeb); / * Teeb qhov ci ci rau qhov nruab nrab qhov tseem ceeb */ lc.setIntensity (0, 8); / * thiab tshem cov zaub */ lc.clearDisplay (0); }

/*

Txoj hauv kev no yuav tso tawm cov cim rau lo lus "Arduino" ib qho dhau ib qho ntawm daim ntawv. (koj xav tau tsawg kawg 5x7 leds kom pom tag nrho cov cim) */ tsis muaj dab tsi sauArduinoOnMatrix () {/ *nov yog cov ntaub ntawv rau cov cim */ byte a [5] = {B01111110, B10001000, B10001000, B10001000, B01111110}; byte r [5] = {B00111110, B00010000, B00100000, B00100000, B00010000}; byte d [5] = {B00011100, B00100010, B00100010, B00010010, B11111110}; byte u [5] = {B00111100, B00000010, B00000010, B00000100, B00111110}; byte kuv [5] = {B00000000, B00100010, B10111110, B00000010, B00000000}; byte n [5] = {B00111110, B00010000, B00100000, B00100000, B00011110}; byte o [5] = {B00011100, B00100010, B00100010, B00100010, B00011100};

/ * tam sim no tso saib lawv ib ntawm ib qho nrog kev ncua me me */

lc.setRow (0, 0, a [0]); lc.setRow (0, 1, a [1]); lc.setRow (0, 2, a [2]); lc.setRow (0, 3, a [3]); lc.setRow (0, 4, a [4]); ncua (ncua sijhawm); lc.setRow (0, 0, r [0]); lc.setRow (0, 1, r [1]); lc.setRow (0, 2, r [2]); lc.setRow (0, 3, r [3]); lc.setRow (0, 4, r [4]); ncua (ncua sijhawm); lc.setRow (0, 0, d [0]); lc.setRow (0, 1, d [1]); lc.setRow (0, 2, d [2]); lc.setRow (0, 3, d [3]); lc.setRow (0, 4, d [4]); ncua (ncua sijhawm); lc.setRow (0, 0, u [0]); lc.setRow (0, 1, u [1]); lc.setRow (0, 2, u [2]); lc.setRow (0, 3, u [3]); lc.setRow (0, 4, u [4]); ncua (ncua sijhawm); lc.setRow (0, 0, i [0]); lc.setRow (0, 1, i [1]); lc.setRow (0, 2, i [2]); lc.setRow (0, 3, i [3]); lc.setRow (0, 4, i [4]); ncua (ncua sijhawm); lc.setRow (0, 0, n [0]); lc.setRow (0, 1, n [1]); lc.setRow (0, 2, n [2]); lc.setRow (0, 3, n [3]); lc.setRow (0, 4, n [4]); ncua (ncua sijhawm); lc.setRow (0, 0, o [0]); lc.setRow (0, 1, o [1]); lc.setRow (0, 2, o [2]); lc.setRow (0, 3, o [3]); lc.setRow (0, 4, o [4]); ncua (ncua sijhawm); lc.setRow (0, 0, 0); lc.setRow (0, 1, 0); lc.setRow (0, 2, 0); lc.setRow (0, 3, 0); lc.setRow (0, 4, 0); ncua (ncua sijhawm); }

/*

Txoj haujlwm no teeb qee qhov Leds uake. Tus qauv yuav rov ua dua ntawm txhua kab. Tus qauv yuav ntsais nrog rau kab-tus lej. kab zauv 4 (ntsuas == 3) yuav ntsais 4 zaug thiab lwm yam */ tsis muaj kab () {rau (int kab = 0; kab lus <8; kab ++) {ncua (ncua sijhawm)); lc.setRow (0, kab, B10100000); ncua (ncua sijhawm); lc.setRow (0, kab, (byte) 0); rau (int i = 0; i

/*

Txoj haujlwm no teeb qee qhov Leds hauv kab. Tus qauv yuav rov ua dua ntawm txhua kab ntawv. Tus qauv yuav ntsais nrog rau kab ntawv-tus lej. kem tus lej 4 (qhov ntsuas == 3) yuav ntsais 4 zaug thiab lwm yam */ void columns () {rau (int col = 0; col <8; col ++) {ncua (ncua sijhawm)); lc.setColumn (0, col, B10100000); ncua (ncua sijhawm); lc.setColumn (0, col, (byte) 0); rau (int i = 0; i

/*

Qhov kev ua haujlwm no yuav ua kom pom txhua Led ntawm lub matrix. Cov coj yuav ntsais nrog rau kab-tus lej. kab ntawv 4 (qhov ntsuas == 3) yuav ntsais 4 zaug thiab lwm yam */ tsis muaj ib leeg () {rau (int kab = 0; kab ntawv <8; kab ntawv ++) {rau (int col = 0; col <8; col ++) { ncua (ncua sijhawm); lc.setLed (0, kab, col, tseeb); ncua (ncua sijhawm); rau (int i = 0; i

void voj () {

writeArduinoOnMatrix (); kab (); kab (); tib (); }

Kuv kuj nthuav qhia nws ua ntaub ntawv:

Kauj ruam 5: Enjoi Nws

Enjoi Nws
Enjoi Nws

Qhov ntawd yog kev qhia ntawm coj matrix.

Ua tsaug rau koj nyeem kab lus no. pom koj hauv kab lus tom ntej.

Pom zoo: