How to Interface Dot Matrix Module w/ Arduino



Download 453,51 Kb.
Sana17.07.2022
Hajmi453,51 Kb.
#814024
Bog'liq
labaraturiya o`rnatilgan tizim


O‘ZBEKISTON RESPUBLIKASI AXBOROT TEXNOLOGIYALARI VA KOMMUNIKATSIYALARINI RIVOJLANTIRISH VAZIRLIGI
MUHAMMAD AL-XORAZMIY NOMIDAGI
TOSHKENT AXBOROT TEXNOLOGIYALARI UNIVERSITETI

O‘rnatilgan tizimlar fanidan



Labaratoriya

Bajardi: Jamoliddinov Ibrohim


Qabul qildi: Dilshod Jurayev

Toshkent 2022
8x8 Matrix
This version of the LED backpack is designed for the 1.2" 8x8 matrices. They measure only 1.2"x1.2" so its a shame to use a massive array of chips to control it. This backpack solves the annoyance of using 16 pins or a bunch of chips by having an I2C constant-current matrix controller sit neatly on the back of the PCB. The controller chip takes care of everything, drawing all 64 LEDs in the background. All you have to do is write data to it using the 2-pin I2C interface. There are two address select pins so you can select one of 8 addresses to control up to 8 of these on a single 2-pin I2C bus (as well as whatever other I2C chips or sensors you like). The driver chip can 'dim' the entire display from 1/16 brightness up to full brightness in 1/16th steps. It cannot dim individual LEDs, only the entire display at once.

How to Interface Dot Matrix Module w/ Arduino

Circuit


To connect the Dot Matrix to Arduino, simply connect the Vcc and GND pins to 5V and GND Arduino, and the DIN, CS, and CLK pins of dot matrix can be connected to any digital pins of arduino.

Code


There are various libraries for Dot matrix and Arduino. The Ledcontrol and MaxMatrixlibraries are two of the most common libraries, both have the same structure.
Now upload the following code on your Arduino board.
/*
8x8 Dot Matrix w/ MAX7219
modified on 7 March 2019
by Saeed Hosseini @ Electropeak
https://electropeak.com/learn/
*/
#include
int DIN = 7;
int CLK = 6;
int CS = 5;
int maxInUse = 1;
byte buffer[20];
char text[] = "a";
MaxMatrix m(DIN, CS, CLK, maxInUse);
void setup() {
m.init();
m.setIntensity(8);
}
void loop() {
m.setDot(0, 7, true);
m.setDot(0, 7, true);
delay(1000);
m.setDot(7, 0, true);
delay(1000);
m.setColumn(3, B11110000);
delay(1000);
m.setColumn(4, B00001111);
delay(1000);
m.clear();
delay(1000);
}
Some of the most important functions of this library are as follows:



8x8 matrisada 10 ta alifbo harfini o’sish tartibida chiqarish.

Jamoliddinov Ibrohim Sirojiddin o'g'li (Kompyuter injiniring - 214-19 КIi)

Code:
#include


int DIN = 11;
int CS = 10;
int CLK = 13;

LedControl lc = LedControl(DIN,CLK,CS, 0);

void setup() {
lc.shutdown(true,0);
lc.setIntensity(0,15);
lc.clearDisplay(0);
}

void loop() {

byte e[8] = {0x7E,0x7E,0x6,0x7E,0x7E,0x6,0x7E,0x7E};
printqil(e);
delay(1000);

byte c[8] = {0x7E,0x7E,0x6,0x6,0x6,0x6,0x7E,0x7E};


printqil(c);
delay(1000);

byte b[8] = {0x7E,0x7E,0x18,0x18,0x18,0x18,0x18,0x18};


printqil(b);
delay(1000);

byte a[8] = {0x3E,0x7E,0x76,0x3E,0x3E,0x76,0x7E,0x3E};


printqil(a);
delay(1000);

byte d[8] = {0x3E,0x7E,0x66,0x66,0x66,0x66,0x7E,0x3E};


printqil(d);
delay(1000);

byte t[8] = {0x7E,0x7E,0x18,0x18,0x18,0x18,0x18,0x18};


printqil(t);
delay(1000);

byte f[8] = {0x7E,0x7E,0x6,0x7E,0x7E,0x6,0x6,0x6};


printqil(f);
delay(1000);

byte h[8] = {0x66,0x66,0x66,0x7E,0x7E,0x66,0x66,0x66};


printqil(h);
delay(1000);

byte i[8] = {0x3c,0x3c,0x18,0x18,0x18,0x18,0x3c,0x3c};


printqil(i);
delay(1000);

byte u[8] = {0x66,0x66,0x66,0x66,0x66,0x66,0x7E,0x3C};


printqil(u);
delay(1000);
}

void printqil(byte belgilar[]){


int i=0;
for (i=0; i<8; i++)
{
lc.setRow(0,i, belgilar[i]);
}
}

Natija:



Vazifani wokvida kurish uchun “ctrl”ni bosib ustiga bosing
Download 453,51 Kb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish