İlk olarak ekrana FERHAT harflerini teker teker yazırma işlemi. Kartımız ve segment ledimiz ile yapılan
bir proje. Harfler teker teker led üzerinde yanacak sonra diğer harfe geçecek şekilde
int a=4;int b=5;int c=6;int d=7;int e=8;int f=3;int g=2;void setup(){pinMode(a,OUTPUT);pinMode(b,OUTPUT);pinMode(c,OUTPUT);pinMode(d,OUTPUT);pinMode(e,OUTPUT);pinMode(f,OUTPUT);pinMode(e,OUTPUT);pinMode(g,OUTPUT);}void loop(){digitalWrite(a,LOW);digitalWrite(e,LOW);digitalWrite(f,LOW);digitalWrite(g,LOW);delay(1000);digitalWrite(b,HIGH);digitalWrite(c,HIGH);digitalWrite(d,HIGH);delay(1000);digitalWrite(b,HIGH);digitalWrite(c,HIGH);digitalWrite(d,HIGH);delay(1000);digitalWrite(a,LOW);digitalWrite(e,LOW);digitalWrite(f,LOW);digitalWrite(g,LOW);digitalWrite(d,LOW);delay(1000);digitalWrite(d,HIGH);digitalWrite(b,LOW);digitalWrite(c,LOW);delay(1000);digitalWrite(a,HIGH);delay(1000);digitalWrite(a,LOW);delay(1000);digitalWrite(b,HIGH);digitalWrite(c,HIGH);digitalWrite(g,HIGH);delay(1000);digitalWrite(a,HIGH);digitalWrite(b,HIGH);digitalWrite(c,HIGH);digitalWrite(d,HIGH);digitalWrite(e,HIGH);digitalWrite(f,HIGH);digitalWrite(g,HIGH);delay(4000);}
Proje - 2
Arduino ile çıkarma işlemi yaptığımıda sonucu ekrana yazan projemiz. Sonucun rakamları teker teker ekrana sırasıyla
yazılacaktır.
Çıkarma İşlemi : 1476-12=1464 Yani ledimizde 1464 yazacak sırasıyla
int a=4;int b=5;int c=6;int d=7;int e=8;int f=3;int g=2;void setup(){pinMode(a,OUTPUT);pinMode(b,OUTPUT);pinMode(c,OUTPUT);pinMode(d,OUTPUT);pinMode(e,OUTPUT);pinMode(f,OUTPUT);pinMode(e,OUTPUT);pinMode(g,OUTPUT);}void loop(){int j=0;int islem=0;islem=1476-12;String str=String(islem);int uzunluk=0;String b="";uzunluk=str.length();for(int i=0;i<uzunluk+1;i++){b=String(str[i]);yaz(b);delay(1000);}}void yaz(String islem){if(islem=="1"){digitalWrite(a,1);digitalWrite(b,0);digitalWrite(c,0);digitalWrite(d,1);digitalWrite(e,1);digitalWrite(f,1);digitalWrite(g,1);}else if(islem=="2"){digitalWrite(a,0);digitalWrite(b,0);digitalWrite(c,1);digitalWrite(d,0);digitalWrite(e,0);digitalWrite(f,1);digitalWrite(g,0);delay(1500); // Wait for 1500 millisecond(s)}else if (islem=="3"){digitalWrite(a,0);digitalWrite(b,0);digitalWrite(c,0);digitalWrite(d,0);digitalWrite(e,1);digitalWrite(f,1);digitalWrite(g,0);delay(1500); // Wait for 1500 millisecond(s)}else if (islem=="4"){digitalWrite(a,1);digitalWrite(b,0);digitalWrite(c,0);digitalWrite(d,1);digitalWrite(e,1);digitalWrite(f,0);digitalWrite(g,0);delay(1500); // Wait for 1500 millisecond(s)}else if (islem=="5"){digitalWrite(a,0);digitalWrite(b,1);digitalWrite(c,0);digitalWrite(d,0);digitalWrite(e,1);digitalWrite(f,0);digitalWrite(g,0);delay(1500); // Wait for 1500 millisecond(s)}else if (islem=="6"){digitalWrite(a,0);digitalWrite(b,1);digitalWrite(c,0);digitalWrite(d,0);digitalWrite(e,0);digitalWrite(f,0);digitalWrite(g,0);delay(1500); // Wait for 1500 millisecond(s)}else if (islem=="7"){digitalWrite(a,0);digitalWrite(b,0);digitalWrite(c,0);digitalWrite(d,1);digitalWrite(e,1);digitalWrite(f,1);digitalWrite(g,1);delay(1500); // Wait for 1500 millisecond(s)}else if (islem=="8"){digitalWrite(a,0);digitalWrite(b,0);digitalWrite(c,0);digitalWrite(d,0);digitalWrite(e,0);digitalWrite(f,0);digitalWrite(g,0);delay(1500); // Wait for 1500 millisecond(s)}else if (islem=="9"){digitalWrite(a,0);digitalWrite(b,0);digitalWrite(c,0);digitalWrite(d,0);digitalWrite(e,1);digitalWrite(f,0);digitalWrite(g,0);delay(1500); // Wait for 1500 millisecond(s)}}