7 segmentli led displeyi haqida



Download 1,06 Mb.
bet4/4
Sana10.04.2022
Hajmi1,06 Mb.
#540668
1   2   3   4
Bog'liq
6-Lab

Ulanish


Ushbu tajribada 7-segmentli displeyning har bir AG pinini mos ravishda bitta 200 ohm oqim cheklovchi qarshilikka ulang va keyin 4-11 pinga ulang. GND GND ga ulanadi. Dasturlash orqali biz mos keladigan LED (lar) ni yoqish uchun pin4-11 ning bir yoki bir nechtasini Yuqori darajali qilib sozlashimiz mumkin.
7 segmentli displey va SunFounder Uno platasi orasidagi simlar:

7-segmentli displey

Arduino Uno

A

7

B

6

C

5

D.

11

E

10

F

8

G

9

DP

4

Kom

GND

ulanish diagrammasi

2- rasm. 7 segmentli displayni ulanish diagrammasi

Dasur kodi esa quydagicha bo’ladi



int a=7;
int b=6;
int c=5;
int d=11;
int e=10;
int f=8;
int g=9;
int dp=4;
// 1
void display1(void)
{
digitalWrite(b,HIGH);
digitalWrite(c,HIGH);
}
//
void display2(void)
{
digitalWrite(a,HIGH);
digitalWrite(b,HIGH);
digitalWrite(g,HIGH);
digitalWrite(e,HIGH);
digitalWrite(d,HIGH);
}
// 3
void display3(void)
{
digitalWrite(a,HIGH);
digitalWrite(b,HIGH);
digitalWrite(c,HIGH);
digitalWrite(d,HIGH);
digitalWrite(g,HIGH);
}
// 4
void display4(void)
{
digitalWrite(f,HIGH);
digitalWrite(b,HIGH);
digitalWrite(g,HIGH);
digitalWrite(c,HIGH);
}
// 5
void display5(void)
{
digitalWrite(a,HIGH);
digitalWrite(f,HIGH);
digitalWrite(g,HIGH);
digitalWrite(c,HIGH);
digitalWrite(d,HIGH);
}
// 6
void display6(void)
{
digitalWrite(a,HIGH);
digitalWrite(f,HIGH);
digitalWrite(g,HIGH);
digitalWrite(c,HIGH);
digitalWrite(d,HIGH);
digitalWrite(e,HIGH);
}
// 7
void display7(void)
{
digitalWrite(a,HIGH);
digitalWrite(b,HIGH);
digitalWrite(c,HIGH);
}
// 8
void display8(void)
{
digitalWrite(a,HIGH);
digitalWrite(b,HIGH);
digitalWrite(g,HIGH);
digitalWrite(c,HIGH);
digitalWrite(d,HIGH);
digitalWrite(e,HIGH);
digitalWrite(f,HIGH);
}
void clearDisplay(void)
{
digitalWrite(a,LOW);
digitalWrite(b,LOW);
digitalWrite(g,LOW);
digitalWrite(c,LOW);
digitalWrite(d,LOW);
digitalWrite(e,LOW);
digitalWrite(f,LOW);
}
void display9(void)
{
digitalWrite(a,HIGH);
digitalWrite(b,HIGH);
digitalWrite(g,HIGH);
digitalWrite(c,HIGH);
digitalWrite(d,HIGH);
digitalWrite(f,HIGH);
}
void display0(void)
{
digitalWrite(a,HIGH);
digitalWrite(b,HIGH);
digitalWrite(c,HIGH);
digitalWrite(d,HIGH);
digitalWrite(e,HIGH);
digitalWrite(f,HIGH);
}
void setup()
{
int i;
for(i=4;i<=11;i++)
pinMode(i,OUTPUT);
}
void loop()
{
while(1)
{ clearDisplay();
display0();
delay(2000);
clearDisplay();
display1();
delay(2000);
clearDisplay();
display2();
delay(2000);
clearDisplay();
display3();
delay(2000);
clearDisplay();
display4();
delay(2000);
clearDisplay();
display5();
delay(2000);
clearDisplay();
display6();
delay(2000);
clearDisplay();
display7();
delay(2000);
clearDisplay();
display8();
delay(2000);
clearDisplay();
display9();
delay(2000);
}
}

5. Nazorat savollari.

1. 7 segmentli displey nima uchun qo’llaniladi?


2. 7 segmentli displey qanday tuzilishga ega?
3. 7 segmentli displeyni qanday turlarini bilasiz?
4. 7 segmentli displeyni qayerlarda qo’llash mumkin?
5. 7 segmentli displeyga dastur qay tarzda yoziladi?
6. Led lampalari bilan 7 segmentli displeyni uxshashlik tomonlari bormi?

Nazorat savollariga javoblar:


2.






Download 1,06 Mb.

Do'stlaringiz bilan baham:
1   2   3   4




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