Loyiha
Kompyuteringizda Arduino IDE yoki online simulyator dasturini oching. Arduino muhitida dasturlashlash sizning sxemangizni boshqaradi.
5 mm LED spetsifikatsiyalari
5 mm LED elektr va optik xususiyatlari
LEDlar turli o'lcham va shakllarda mavjud, jumladan 5 mm LED. Biz 3 mm, 5 mm, 8 mm va 10 mm modellarning eng keng tarqalgan modellarining keng assortimentini taqdim etamiz.
Hajmi LEDning tashqi diametriga ishora qiladi, 5 mm LED eng keng tarqalgan LED modeli sifatida sanoat standarti hisoblanadi. 3 mm LEDlar eng kichik va mahkam o'rnatiladigan ilovalarda qo'llaniladi, 8 mm va 10 mm modellar esa iloji boricha ko'proq yorug'likni olishni istagan joylarda qo'llaniladi.
5 mm LEDning umumiy ko'rinishi
Super Bright 5 mm LED keng nur burchagi bilan juda yorqin, shuning uchun ular loyihalaringiz, yoritgichlar, faralar, yorug'lik chiroqlari, avtomobil yoritgichlari va modellaringizda foydalanish uchun mos keladi. 5 mm LEDni kam quvvat, yuqori zichlikdagi ishonchli yorug'lik yoki ko'rsatkich kerak bo'lgan har qanday joyda ishlatish mumkin. Ular tezda non taxtasiga kiradi va sizning loyihangizga qo'shimcha zing qo'shadi.
5 mm T1 3/4 LED mavjud LEDning eng keng tarqalgan o'lchamidir.
LEDlar turli o'lcham va shakllarda mavjud, jumladan 4,8 mm Straw Hat LED. Biz 3 mm , 5 mm , 8 mm va 10 mm modellarning eng keng tarqalgan modellarining keng assortimentini taqdim etamiz .
5 mm LEDlar kam quvvat, yuqori zichlikdagi ishonchli yorug'lik yoki ko'rsatkichga muhtoj bo'lgan har qanday joyda ishlatilishi mumkin. Ular non taxtasiga osongina kirib boradi va sizning loyihangizga qo'shimcha zing qo'shadi.
LED terminali simlarini qanday aniqlash mumkin
LED musbat (anod) va salbiy (katod) simga ega. LEDning sxematik belgisi diodaga o'xshaydi, tashqariga qaragan ikkita o'qdan tashqari. Anod (+) uchburchak bilan, katod (-) esa chiziq bilan belgilanadi.
// C++ code
//
int led1=2;
int led2=3;
int led3=4;
int led4=5;
int led5=6;
int led6=7;
int but1=8;
int but2=9;
int sum1=0;
int sum2=0;
void setup()
{
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
pinMode(but1, INPUT);
pinMode(but2, INPUT);
Serial.begin(9600);
}
void loop()
{
if(digitalRead(but2)){
if(sum1<2){sum1++;}
else sum1=0;
Serial.print(sum1);
}
if(digitalRead(but1)){
if(sum2<6)sum2++;
else sum2=0;
Serial.print(sum2);
}
switch(sum1)
case 0:{
switch(sum2)
{
case 0:
digitalWrite(led1,LOW);
digitalWrite(led2,LOW);
digitalWrite(led3,LOW);
digitalWrite(led4,LOW);
digitalWrite(led5,LOW);
digitalWrite(led6,LOW);
break;
case 1:
digitalWrite(led1,HIGH);
digitalWrite(led2,LOW);
digitalWrite(led3,LOW);
digitalWrite(led4,LOW);
digitalWrite(led5,LOW);
digitalWrite(led6,LOW);
break;
case 2:
digitalWrite(led1,HIGH);
digitalWrite(led2,HIGH);
digitalWrite(led3,LOW);
digitalWrite(led4,LOW);
digitalWrite(led5,LOW);
digitalWrite(led6,LOW);
break;
case 3:
digitalWrite(led1,HIGH);
digitalWrite(led2,HIGH);
digitalWrite(led3,HIGH);
digitalWrite(led4,LOW);
digitalWrite(led5,LOW);
digitalWrite(led6,LOW);
break;
case 4:
digitalWrite(led1,HIGH);
digitalWrite(led2,HIGH);
digitalWrite(led3,HIGH);
digitalWrite(led4,HIGH);
digitalWrite(led5,LOW);
digitalWrite(led6,LOW);
break;
case 5:
digitalWrite(led1,HIGH);
digitalWrite(led2,HIGH);
digitalWrite(led3,HIGH);
digitalWrite(led4,HIGH);
digitalWrite(led5,HIGH);
digitalWrite(led6,LOW);
break;
case 6:
digitalWrite(led1,HIGH);
digitalWrite(led2,HIGH);
digitalWrite(led3,HIGH);
digitalWrite(led4,HIGH);
digitalWrite(led5,HIGH);
digitalWrite(led6,HIGH);
break;
}
case 1:
digitalRead((but2)==LOW);
}
while(digitalRead(but1)==HIGH)
{
delay(10);
}
delay(50);
}
Sayt linkasi: https://www.tinkercad.com/things/9qeyNBb2sYL-amaliy-wuncaki/editel?sharecode=Qzn80nEQIdERuzAkSQWdgRGcCD-7yRrqITzodwRXIEc
Do'stlaringiz bilan baham: |