Kod qism - O‘rnatilgan tizimlari fanidan 3-topshiriq mavzu: Bir razryadli va to’rt razryadli yetti segmetli indikator(display)...

|
O‘rnatilgan tizimlari fanidan 3-topshiriq mavzu: Bir razryadli va to’rt razryadli yetti segmetli indikator(display) Bajardi
|
bet | 2/2 | Sana | 14.05.2024 | Hajmi | 185,83 Kb. | | #230936 |
Bog'liq 1714031287 (1)Kod qism
const int a=2;
const int b=3;
const int c=4;
const int d=5;
const int e=6;
const int f=7;
const int g=8;
const int dp=9;
int raqam=0;
void setup(){
Serial.begin(9600);
for(int i=2;i<9;i++){
pinMode(i,OUTPUT);
}
pinMode(A0, INPUT);
}
void loop(){
int a=analogRead(A0);
raqam=map(a, 0, 1023, 0, 9);
switch(raqam){
case 0: nol();break;
case 1: bir();break;
case 2: ikki();break;
case 3: uch();break;
case 4: turt();break;
case 5: besh();break;
case 6: olti();break;
case 7: yetti();break;
case 8: sakkiz();break;
case 9: tuqqiz();break;
default: tozala();break;
}
}
void son(int raqam){
switch(raqam){
case 0: nol();break;
case 1: bir();break;
case 2: ikki();break;
case 3: uch();break;
case 4: turt();break;
case 5: besh();break;
case 6: olti();break;
case 7: yetti();break;
case 8: sakkiz();break;
case 9: tuqqiz();break;
default: tozala();break;
}
}
void tozala(){
digitalWrite(a,0);
digitalWrite(b,0);
digitalWrite(c,0);
digitalWrite(d,0);
digitalWrite(e,0);
digitalWrite(f,0);
digitalWrite(g,0);
digitalWrite(dp,1);
}
void nol(){
digitalWrite(a,1);
digitalWrite(b,1);
digitalWrite(c,1);
digitalWrite(d,1);
digitalWrite(e,1);
digitalWrite(f,1);
digitalWrite(g,0);
digitalWrite(dp,1);
}
void bir(){
digitalWrite(a,0);
digitalWrite(b,1);
digitalWrite(c,1);
digitalWrite(d,0);
digitalWrite(e,0);
digitalWrite(f,0);
digitalWrite(g,0);
digitalWrite(dp,1);
}
void ikki(){
digitalWrite(a,1);
digitalWrite(b,1);
digitalWrite(c,0);
digitalWrite(d,1);
digitalWrite(e,1);
digitalWrite(f,0);
digitalWrite(g,1);
digitalWrite(dp,1);
}
void uch(){
digitalWrite(a,1);
digitalWrite(b,1);
digitalWrite(c,1);
digitalWrite(d,1);
digitalWrite(e,0);
digitalWrite(f,0);
digitalWrite(g,1);
digitalWrite(dp,1);
}
void turt(){
digitalWrite(a,0);
digitalWrite(b,1);
digitalWrite(c,1);
digitalWrite(d,0);
digitalWrite(e,0);
digitalWrite(f,1);
digitalWrite(g,1);
digitalWrite(dp,1);
}
void besh(){
digitalWrite(a,1);
digitalWrite(b,0);
digitalWrite(c,1);
digitalWrite(d,1);
digitalWrite(e,0);
digitalWrite(f,1);
digitalWrite(g,1);
digitalWrite(dp,1);
}
void olti(){
digitalWrite(a,1);
digitalWrite(b,0);
digitalWrite(c,1);
digitalWrite(d,1);
digitalWrite(e,1);
digitalWrite(f,1);
digitalWrite(g,1);
digitalWrite(dp,1);
}
void yetti(){
digitalWrite(a,1);
digitalWrite(b,1);
digitalWrite(c,1);
digitalWrite(d,0);
digitalWrite(e,0);
digitalWrite(f,0);
digitalWrite(g,0);
digitalWrite(dp,1);
}
void sakkiz(){
digitalWrite(a,1);
digitalWrite(b,1);
digitalWrite(c,1);
digitalWrite(d,1);
digitalWrite(e,1);
digitalWrite(f,1);
digitalWrite(g,1);
digitalWrite(dp,1);
}
void tuqqiz(){
digitalWrite(a,1);
digitalWrite(b,1);
digitalWrite(c,1);
digitalWrite(d,1);
digitalWrite(e,0);
digitalWrite(f,1);
digitalWrite(g,1);
digitalWrite(dp,1);
}
Online havola
https://www.tinkercad.com/things/ejbCYy21jNP-funky-uusam/editel?sharecode=aUi2Do1dg7XbD7OOVo52Pl6Y47puewfseORlWSB4-xE
Xulosa: Xulosa qilib aytadigan bo’lsam men bu topshiriqni bajarish davomida tinkercad.com sayti orqali potensiometr, bir razryadli yetti segmentli indikator orqali sonlarni o`sish va kamayish tartibida chiqarishni ko`rib chiqdim.
Bu topshiriqni bajarish davomida men bir razryadli yetti segmentli indikatorni ulash sxemalarini nazariy va amaliy jihatdan o’rganib chiqdim.
|
|
Bosh sahifa
Aloqalar
Bosh sahifa
O‘rnatilgan tizimlari fanidan 3-topshiriq mavzu: Bir razryadli va to’rt razryadli yetti segmetli indikator(display) Bajardi
|