Laboratoriya ishi №13. Yetti segmentli bitta raqamli ko‘rsatkich. Laboratoriya ishining maqsadi



Download 0,93 Mb.
bet11/11
Sana12.06.2022
Hajmi0,93 Mb.
#657820
1   2   3   4   5   6   7   8   9   10   11
Bog'liq
3-DETLINE

Laboratoriyaning amaliy qismi.
MAX7219 -dagi 8x8 LED matritsasini Arduinoga ulash
Modelni yig‘ish uchun bizga kerak:

  • Arduino UNO R3 x 1 dona.

  • LED matritsasi 8 × 8 MAX7219 x 1 dona.

  • DuPont simlari, 2,54 mm, 20 sm x 1 dona.

Modelning Arduinoga ulanish sxemasi:

    • DIN moduli pinli Arduino pin8

    • Arduino pin9 modulining CS pinli

    • CLK pinli Arduino pin10

    • VCC moduli pinli 5V quvvat manbai (agar bir nechta matritsali modullar mavjud bo‘lsa, Arduino quvvati etarli bo‘lmaydi va modullar tashqi quvvat manbaidan quvvatlanishi kerak bo‘ladi)

    • GND pinini modulga ulash



Ushbu model uchun quyidagi dastur yozishimiz mumkin:
unsigned char i;
unsigned char j;

int Max7219_pinCLK = 10;


int Max7219_pinCS = 9;
int Max7219_pinDIN = 8;

unsigned char disp1[33][8] = {


0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // yurak rasmi
0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x40, 0x40, 0x00, 0x00, 0x00,
0x00, 0x00, 0x80, 0x40, 0x40, 0x00, 0x00, 0x00,
0x00, 0x80, 0x80, 0x40, 0x40, 0x00, 0x00, 0x00,
0x40, 0x80, 0x80, 0x40, 0x40, 0x00, 0x00, 0x00,
0x60, 0x80, 0x80, 0x40, 0x40, 0x00, 0x00, 0x00,
0x60, 0x90, 0x80, 0x40, 0x40, 0x00, 0x00, 0x00,
0x60, 0x90, 0x88, 0x40, 0x40, 0x00, 0x00, 0x00,
0x60, 0x90, 0x88, 0x44, 0x40, 0x00, 0x00, 0x00,
0x60, 0x90, 0x88, 0x44, 0x44, 0x00, 0x00, 0x00,
0x60, 0x90, 0x88, 0x44, 0x44, 0x08, 0x00, 0x00,
0x60, 0x90, 0x88, 0x44, 0x44, 0x08, 0x10, 0x00,
0x60, 0x90, 0x88, 0x44, 0x44, 0x08, 0x10, 0x20,
0x60, 0x90, 0x88, 0x44, 0x44, 0x08, 0x10, 0x60,
0x60, 0x90, 0x88, 0x44, 0x44, 0x08, 0x90, 0x60,
0x60, 0x90, 0x88, 0x44, 0x44, 0x88, 0x90, 0x60 // yurak rasmi
};

void Write_Max7219_byte(unsigned char DATA) {


unsigned char i;
digitalWrite(Max7219_pinCS, LOW);
for (i = 8; i >= 1; i--) {
digitalWrite(Max7219_pinCLK, LOW);
digitalWrite(Max7219_pinDIN, DATA & 0x80);
DATA = DATA << 1;
digitalWrite(Max7219_pinCLK, HIGH);
}
}

void Write_Max7219(unsigned char address, unsigned char dat) {


digitalWrite(Max7219_pinCS, LOW);
Write_Max7219_byte(address);
Write_Max7219_byte(dat);
digitalWrite(Max7219_pinCS, HIGH);
}

void Init_MAX7219(void) {


Write_Max7219(0x09, 0x00);
Write_Max7219(0x0a, 0x03);
Write_Max7219(0x0b, 0x07);
Write_Max7219(0x0c, 0x01);
Write_Max7219(0x0f, 0x00);
}

void setup() {


pinMode(Max7219_pinCLK, OUTPUT);
pinMode(Max7219_pinCS, OUTPUT);
pinMode(Max7219_pinDIN, OUTPUT);
delay(50);
Init_MAX7219();
}

void loop() {


//yurak rasmini chizami
for (j = 0; j < 17; j++) {
for (i = 1; i < 9; i++)
Write_Max7219(i, disp1[j][i - 1]);
delay(100);
}
// hamma narsani bo‘yash
for (i = 1; i < 9; i++) {
Write_Max7219(i, 0xFF);
delay(100);
}
//все стираем
for (i = 1; i < 9; i++) {
Write_Max7219(i, 0x00);
delay(100);
}
//пауза
delay(800);
}
Arduinoga o‘rnatilgan tugmachani LED bilan shunday ko‘rinishga ega:


Foydalanilgan internet resurslar.
1. https://robotchip.ru/obzor-svetodiodnoy-matritsy-8x8-na-max7219/
2. https://2150692.ru/faq/114-led-matrix-8x8
3. https://www.youtube.com/watch?v=-p2swlsbATw


Laboratoriya ishi uchun topshiriqlar.
1. Laboratoriya ishining nazariy materialini o‘rganish.
2. Bundan tashqari, laboratoriya ishlari uchun ishlatilgan Internet -resurslarni o‘rganing.
3. Arduinosxemalarini o‘zingiz ulang.
4. Arduino IDEda mustaqil ravishda bu ish uchun dastur yozing.
Download 0,93 Mb.

Do'stlaringiz bilan baham:
1   2   3   4   5   6   7   8   9   10   11




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