Mavzu: To`rt razryadli yeti segmentli indicator yordamida jarayonlarni boshqarish

|
Mavzu: To`rt razryadli yeti segmentli indicator yordamida jarayonlarni boshqarish
|
bet | 4/4 | Sana | 22.11.2023 | Hajmi | 384,25 Kb. | | #103176 |
Bog'liq 2-topshiriqMavzu: To`rt razryadli yeti segmentli indicator yordamida jarayonlarni boshqarish
Qisqacha nazariy ma’lumotlar
Etti segmentli LED ko'rsatkichlari raqamli qiymatni ko'rsatadigan qurilmalar orasida juda mashhur bo'lib, mikroto'lqinli pechlar, kir yuvish mashinalari, raqamli soatlar, hisoblagichlar, taymerlar va boshqalarning old panellarida qo'llaniladi. LCD ko'rsatkichlari bilan solishtirganda, LED indikatorining segmentlari yorqin porlaydi va uzoq masofada va keng ko'rish burchagida ko'rinadi. Etti segmentli 4-raqamli indikatorni mikrokontrollerga ulash uchun kamida 12 kirish / chiqish liniyasi talab qilinadi. Shuning uchun, bu ko'rsatkichlarni kam sonli pinli mikrokontrollerlar bilan ishlatish deyarli mumkin emas, masalan, kompaniya seriyasi. Albatta, siz turli xil multiplekslash usullaridan foydalanishingiz mumkin (ularning tavsifi "Sxemalar" bo'limida saytdan topish mumkin), lekin bu holatda ham har bir usul uchun ma'lum cheklovlar mavjud va ko'pincha ular murakkab dasturiy ta'minot algoritmlaridan foydalanadilar.
Amaliy qism
Kerakli komponentalar
Arduino Uno ,
Ulash simlari,
4 razryadli 7 segmentli display
https://www.tinkercad.com/things/6vLveW1IJjS-epic-hillar-bruticus/editel?sharecode=Rsuc421ucrReP2twCT6KfdMSIR-KquBy6JkilytwEC8
Kod qismi:
int pinA = 2;
int pinB = 3;
int pinC = 4;
int pinD = 5;
int pinE = 6;
int pinF = 7;
int pinG = 8;
int D1 = 9;
int D2 = 10;
int D3 = 11;
int D4 = 12;
void setup() {
pinMode(pinA, OUTPUT);
pinMode(pinB, OUTPUT);
pinMode(pinC, OUTPUT);
pinMode(pinD, OUTPUT);
pinMode(pinE, OUTPUT);
pinMode(pinF, OUTPUT);
pinMode(pinG, OUTPUT);
pinMode(D1, OUTPUT);
pinMode(D2, OUTPUT);
pinMode(D3, OUTPUT);
pinMode(D4, OUTPUT);
}
void loop() {
digitalWrite(D1, HIGH);
digitalWrite(D2, LOW);
digitalWrite(D3, LOW);
digitalWrite(D4, LOW);
//0
digitalWrite(pinA, LOW);
digitalWrite(pinB, LOW);
digitalWrite(pinC, LOW);
digitalWrite(pinD, LOW);
digitalWrite(pinE, LOW);
digitalWrite(pinF, LOW);
digitalWrite(pinG, HIGH);
delay(1000);
digitalWrite(D1, LOW);
digitalWrite(D2, HIGH);
digitalWrite(D3, LOW);
digitalWrite(D4, LOW);
//1
digitalWrite(pinA, HIGH);
digitalWrite(pinB, LOW);
digitalWrite(pinC, LOW);
digitalWrite(pinD, HIGH);
digitalWrite(pinE, HIGH);
digitalWrite(pinF, HIGH);
digitalWrite(pinG, HIGH);
delay(1000);
digitalWrite(D1, LOW);
digitalWrite(D2, LOW);
digitalWrite(D3, HIGH);
digitalWrite(D4, LOW);
//2
digitalWrite(pinA, LOW);
digitalWrite(pinB, LOW);
digitalWrite(pinC, HIGH);
digitalWrite(pinD, LOW);
digitalWrite(pinE, LOW);
digitalWrite(pinF, HIGH);
digitalWrite(pinG, LOW);
delay(1000);
digitalWrite(D1, LOW);
digitalWrite(D2, LOW);
digitalWrite(D3, LOW);
digitalWrite(D4, HIGH);
//3
digitalWrite(pinA, LOW);
digitalWrite(pinB, LOW);
digitalWrite(pinC, LOW);
digitalWrite(pinD, LOW);
digitalWrite(pinE, HIGH);
digitalWrite(pinF, HIGH);
digitalWrite(pinG, LOW);
delay(1000);
//4
digitalWrite(pinA, HIGH);
digitalWrite(pinB, LOW);
digitalWrite(pinC, LOW);
digitalWrite(pinD, HIGH);
digitalWrite(pinE, HIGH);
digitalWrite(pinF, LOW);
digitalWrite(pinG, LOW);
delay(1000);
//5
digitalWrite(pinA, LOW);
digitalWrite(pinB, HIGH);
digitalWrite(pinC, LOW);
digitalWrite(pinD, LOW);
digitalWrite(pinE, HIGH);
digitalWrite(pinF, LOW);
digitalWrite(pinG, LOW);
delay(1000);
//6
digitalWrite(pinA, LOW);
digitalWrite(pinB, HIGH);
digitalWrite(pinC, LOW);
digitalWrite(pinD, LOW);
digitalWrite(pinE, LOW);
digitalWrite(pinF, LOW);
digitalWrite(pinG, LOW);
delay(1000);
//7
digitalWrite(pinA, LOW);
digitalWrite(pinB, LOW);
digitalWrite(pinC, LOW);
digitalWrite(pinD, HIGH);
digitalWrite(pinE, HIGH);
digitalWrite(pinF, HIGH);
digitalWrite(pinG, HIGH);
delay(1000);
//8
digitalWrite(pinA, LOW);
digitalWrite(pinB, LOW);
digitalWrite(pinC, LOW);
digitalWrite(pinD, LOW);
digitalWrite(pinE, LOW);
digitalWrite(pinF, LOW);
digitalWrite(pinG, LOW);
delay(1000);
//9
digitalWrite(pinA, LOW);
digitalWrite(pinB, LOW);
digitalWrite(pinC, LOW);
digitalWrite(pinD, HIGH);
digitalWrite(pinE, HIGH);
digitalWrite(pinF, LOW);
digitalWrite(pinG, LOW);
delay(1000);
}
XULOSA
Men ushbu amaliy topshiriqni bajarish davomida RGB led lampasining Arduino Uno va boshqa elementlar bilan yonish holatlarini ,qanday ulanishlari va qanday ishlash holatlarini ko`rib chiqdim va yana 1 razryadli 7 segmentli displayni ham Arduino Uno va boshqa elementlar bilan ishlashini qanday ulanishlarini va u yordamida raqamlar chiqarish orqali uning imkoniyatlari haqida ko`plab bilim va ko`nikmalarga ega bo`ldim,Tinkercard muhitida bu jarayonlarning xilma-xilligini kod orqali boshqarishni ham o`rganib oldim.Bu jarayonlarni real hayotda ko`p holatda ko`rishimiz mumkin.Masalan ko`chalarda yoki bazi binolarning chiroqli illuziyaviy holatlarida ko`rishimiz mumkin.
|
| |