Arduino mikrokontollyorida uch tomonlama svetofor loyihasini yaratish



Download 179,76 Kb.
bet2/2
Sana13.12.2022
Hajmi179,76 Kb.
#884607
1   2
Bog'liq
Svetofor projekt

Kod va ulanish sxemasiga ilova.
https://wokwi.com/projects/350667337042494035

#DEFINE RED1 11


#DEFINE ORG1 12
#DEFINE GRN1 13
#DEFINE RED2 8
#DEFINE ORG2 9
#DEFINE GRN2 10
#DEFINE RED3 7
#DEFINE ORG3 6
#DEFINE GRN3 5

INT PAUSE = 3000;


INT PIK = 500;

VOID SETUP() {


PINMODE(RED1, OUTPUT);
PINMODE(ORG1, OUTPUT);
PINMODE(GRN1, OUTPUT);
PINMODE(RED2, OUTPUT);
PINMODE(ORG2, OUTPUT);
PINMODE(GRN2, OUTPUT);
PINMODE(RED3, OUTPUT);
PINMODE(ORG3, OUTPUT);
PINMODE(GRN3, OUTPUT);
}

VOID LOOP {


// BIRINCHI FAZA()


DIGITALWRITE(RED1, HIGH);


DIGITALWRITE(ORG1, LOW);
DIGITALWRITE(GRN1, LOW);
DIGITALWRITE(RED2, HIGH);
DIGITALWRITE(ORG2, LOW);
DIGITALWRITE(GRN2, LOW);
DIGITALWRITE(RED3, LOW);
DIGITALWRITE(ORG3, LOW);
DIGITALWRITE(GRN3, HIGH);
DELAY(PAUSE);

DIGITALWRITE(ORG2, HIGH);


DIGITALWRITE(ORG1, HIGH);
DIGITALWRITE(GRN3, LOW);
DELAY(PIK);
DIGITALWRITE(GRN3, HIGH);
DELAY(PIK);
DIGITALWRITE(GRN3, LOW);
DELAY(PIK);
DIGITALWRITE(GRN3, HIGH);
DELAY(PIK);
DIGITALWRITE(GRN3, LOW);
DELAY(PIK);
DIGITALWRITE(GRN3, HIGH);
DELAY(PIK);

// IKKINCHI FAZA


DIGITALWRITE(RED1, HIGH);


DIGITALWRITE(ORG1, LOW);
DIGITALWRITE(GRN1, LOW);
DIGITALWRITE(RED2, LOW);
DIGITALWRITE(ORG2, LOW);
DIGITALWRITE(GRN2, HIGH);
DIGITALWRITE(RED3, HIGH);
DIGITALWRITE(ORG3, LOW);
DIGITALWRITE(GRN3, LOW);
DELAY(PAUSE);

DIGITALWRITE(ORG3, HIGH);


DIGITALWRITE(ORG1, HIGH);
DIGITALWRITE(GRN2, LOW);
DELAY(PIK);
DIGITALWRITE(GRN2, HIGH);
DELAY(PIK);
DIGITALWRITE(GRN2, LOW);
DELAY(PIK);
DIGITALWRITE(GRN2, HIGH);
DELAY(PIK);
DIGITALWRITE(GRN2, LOW);
DELAY(PIK);
DIGITALWRITE(GRN2, HIGH);
DELAY(PIK);

// UCHINCHI FAZA


DIGITALWRITE(RED1, LOW);


DIGITALWRITE(ORG1, LOW);
DIGITALWRITE(GRN1, HIGH);
DIGITALWRITE(RED2, HIGH);
DIGITALWRITE(ORG2, LOW);
DIGITALWRITE(GRN2, LOW);
DIGITALWRITE(RED3, HIGH);
DIGITALWRITE(ORG3, LOW);
DIGITALWRITE(GRN3, LOW);
DELAY(PAUSE);

DIGITALWRITE(ORG2, HIGH);


DIGITALWRITE(ORG3, HIGH);
DIGITALWRITE(GRN1, LOW);
DELAY(PIK);
DIGITALWRITE(GRN1, HIGH);
DELAY(PIK);
DIGITALWRITE(GRN1, LOW);
DELAY(PIK);
DIGITALWRITE(GRN1, HIGH);
DELAY(PIK);
DIGITALWRITE(GRN1, LOW);
DELAY(PIK);
DIGITALWRITE(GRN1, HIGH);
DELAY(PIK);


}


Download 179,76 Kb.

Do'stlaringiz bilan baham:
1   2




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