Uygulama-1:

int led = 13;

void setup() {
  pinMode(led, OUTPUT);     
}

void loop() {
  digitalWrite(led, HIGH);
  delay(1000);
  digitalWrite(led, LOW);
  delay(1000);
}

Uygulama-2:

void setup() {
  pinMode(6, OUTPUT);
  pinMode(7, INPUT);
}

void loop() {
  if (digitalRead(7))
    digitalWrite(6, HIGH);
  else
    digitalWrite(6, LOW);
}

Uygulama-3:

void setup() {
  pinMode(2,OUTPUT);
  pinMode(3,INPUT);
  pinMode(4,INPUT);
  pinMode(5,INPUT);
}

void loop() {
  if (digitalRead(3) && digitalRead(4) && digitalRead(5))
  digitalWrite(2,1);
  else
  digitalWrite(2,0);
}

Uygulama-4:

void setup() {
  pinMode(2,OUTPUT);
  pinMode(3,INPUT);
  pinMode(4,INPUT);
  pinMode(5,INPUT);
}

void loop() {
  if (digitalRead(3) || digitalRead(4) || digitalRead(5))
  digitalWrite(2,1);
  else
  digitalWrite(2,0);
}

Uygulama-5:

void setup() {
  pinMode(2, OUTPUT);
  pinMode(3, OUTPUT);
  Serial.begin(9600);
}

void loop() {
  digitalWrite(2, LOW);
  digitalWrite(3, LOW);
  Serial.println("0-0 Sonucu 0");
  delay(1000);
  
  digitalWrite(2, LOW);
  digitalWrite(3, HIGH);
  Serial.println("0-1 Sonucu 0");
  delay(1000);
  
  digitalWrite(2, HIGH);
  digitalWrite(3, LOW);
  Serial.println("1-0 Sonucu 0");
  delay(1000);
  
  digitalWrite(2, HIGH);
  digitalWrite(3, HIGH);
  Serial.println("1-1 Sonucu 1");
  delay(1000);
}

Uygulama-6:

void setup() {
  pinMode(2,OUTPUT);
  pinMode(3,OUTPUT);
  pinMode(4,OUTPUT);
  pinMode(5,OUTPUT);
  pinMode(6,INPUT);
  Serial.begin(9600);
}

int pin(int a, int b, int c, int d) {
  digitalWrite(2,a);
  digitalWrite(3,b);
  digitalWrite(4,c);
  digitalWrite(5,d);
  return digitalRead(6);
}

void loop() {
  if (pin(0,0,0,0))
  {
    Serial.println("1,1,1,1 --> Sonuc 1");
    delay(1000);
  }
  else
  {
    Serial.println("0,0,0,0 --> Sonuc 0");
    delay(1000);
  }
  if (pin(0,0,0,1))
  {
    Serial.println("1,1,1,1 --> Sonuc 1");
    delay(1000);
  }
  else
  {
    Serial.println("0,0,0,1 --> Sonuc 0");
    delay(1000);
  }
  if (pin(0,0,1,0))
  {
    Serial.println("1,1,1,1 --> Sonuc 1");
    delay(1000);
  }
  else
  {
    Serial.println("0,0,1,0 --> Sonuc 0");
    delay(1000);
  }
  if (pin(0,0,1,1))
  {
    Serial.println("1,1,1,1 --> Sonuc 1");
    delay(1000);
  }
  else
  {
    Serial.println("0,0,1,1 --> Sonuc 0");
    delay(1000);
  }
  if (pin(0,1,0,0))
  {
    Serial.println("1,1,1,1 --> Sonuc 1");
    delay(1000);
  }
  else
  {
    Serial.println("0,1,0,0 --> Sonuc 0");
    delay(1000);
  }
  if (pin(0,1,0,1))
  {
    Serial.println("1,1,1,1 --> Sonuc 1");
    delay(1000);
  }
  else
  {
    Serial.println("0,1,0,1 --> Sonuc 0");
    delay(1000);
  }
  if (pin(0,1,1,0))
  {
    Serial.println("1,1,1,1 --> Sonuc 1");
    delay(1000);
  }
  else
  {
    Serial.println("0,1,1,0 --> Sonuc 0");
    delay(1000);
  }
  if (pin(0,1,1,1))
  {
    Serial.println("1,1,1,1 --> Sonuc 1");
    delay(1000);
  }
  else
  {
    Serial.println("0,1,1,1 --> Sonuc 0");
    delay(1000);
  }
  if (pin(1,0,0,0))
  {
    Serial.println("1,1,1,1 --> Sonuc 1");
    delay(1000);
  }
  else
  {
    Serial.println("1,0,0,0 --> Sonuc 0");
    delay(1000);
  }
  if (pin(1,0,0,1))
  {
    Serial.println("1,1,1,1 --> Sonuc 1");
    delay(1000);
  }
  else
  {
    Serial.println("1,0,0,1 --> Sonuc 0");
    delay(1000);
  }
  if (pin(1,0,1,0))
  {
    Serial.println("1,1,1,1 --> Sonuc 1");
    delay(1000);
  }
  else
  {
    Serial.println("1,0,1,0 --> Sonuc 0");
    delay(1000);
  }
  if (pin(1,0,1,1))
  {
    Serial.println("1,1,1,1 --> Sonuc 1");
    delay(1000);
  }
  else
  {
    Serial.println("1,0,1,1 --> Sonuc 0");
    delay(1000);
  }
  if (pin(1,1,0,0))
  {
    Serial.println("1,1,1,1 --> Sonuc 1");
    delay(1000);
  }
  else
  {
    Serial.println("1,1,0,0 --> Sonuc 0");
    delay(1000);
  }
  if (pin(1,1,0,1))
  {
    Serial.println("1,1,1,1 --> Sonuc 1");
    delay(1000);
  }
  else
  {
    Serial.println("1,1,0,1 --> Sonuc 0");
    delay(1000);
  }
  if (pin(1,1,1,0))
  {
    Serial.println("1,1,1,1 --> Sonuc 1");
    delay(1000);
  }
  else
  {
    Serial.println("1,1,1,0 --> Sonuc 0");
    delay(1000);
  }
  if (pin(1,1,1,1))
  {
    Serial.println("1,1,1,1 --> Sonuc 1");
    delay(1000);
  }
}

Uygulama-7:

void setup() {
  pinMode(6, OUTPUT);
  pinMode(7, OUTPUT);
  pinMode(12, INPUT);
  pinMode(13, INPUT);
  Serial.begin(9600);
}

void loop() {
  digitalWrite(6, LOW);
  digitalWrite(7, LOW);
  Serial.println("D = 0 ve CLK = 0");
  Serial.println("Q = " + String(digitalRead(12)));
  Serial.println("Q'nun degili = " + String(digitalRead(13)));
  delay(1000);
  
  Serial.println("----------------------");
  
  Serial.println("D = 0 ve CLK = 1");
  digitalWrite(6, LOW);
  digitalWrite(7, HIGH);
  Serial.println("Q = " + String(digitalRead(12)));
  Serial.println("Q'nun degili = " + String(digitalRead(13)));
  delay(1000);
  
  Serial.println("----------------------");
  
  Serial.println("D = 0 ve CLK = 0");
  digitalWrite(6, LOW);
  digitalWrite(7, LOW);
  Serial.println("Q = " + String(digitalRead(12)));
  Serial.println("Q'nun degili = " + String(digitalRead(13)));
  delay(1000);
  
  Serial.println("----------------------");
  
  Serial.println("D = 1 ve CLK = 0");
  digitalWrite(6, HIGH);
  digitalWrite(7, LOW);
  Serial.println("Q = " + String(digitalRead(12)));
  Serial.println("Q'nun degili = " + String(digitalRead(13)));
  delay(1000);
  
  Serial.println("----------------------");
  
  Serial.println("D = 1 ve CLK = 1");
  digitalWrite(6, HIGH);
  digitalWrite(7, HIGH);
  Serial.println("Q = " + String(digitalRead(12)));
  Serial.println("Q'nun degili = " + String(digitalRead(13)));
  delay(1000);
  
  Serial.println("----------------------");
  
  Serial.println("D = 1 ve CLK = 0");
  digitalWrite(6, HIGH);
  digitalWrite(7, LOW);
  Serial.println("Q = " + String(digitalRead(12)));
  Serial.println("Q'nun degili = " + String(digitalRead(13)));
  delay(1000);
  
  Serial.println("----------------------");
}

Uygulama-8:

void setup() {
  pinMode(11, OUTPUT);
  pinMode(12, OUTPUT);
  pinMode(13, OUTPUT);
  pinMode(5, INPUT);
  Serial.begin(9600);
}
void loop() {
  digitalWrite(11, LOW);
  digitalWrite(12, LOW);
  digitalWrite(13, LOW);
  Serial.print("0 0 0 = ");
  Serial.println(digitalRead(5));
  delay(1000);
  
  digitalWrite(11, LOW);
  digitalWrite(12, LOW);
  digitalWrite(13, HIGH);
  Serial.print("0 0 1 = ");
  Serial.println(digitalRead(5));
  delay(1000);
  
  digitalWrite(11, LOW);
  digitalWrite(12, HIGH);
  digitalWrite(13, LOW);
  Serial.print("0 1 0 = ");
  Serial.println(digitalRead(5));
  delay(1000);
  
  digitalWrite(11, LOW);
  digitalWrite(12, HIGH);
  digitalWrite(13, HIGH);
  Serial.print("0 1 1 = ");
  Serial.println(digitalRead(5));
  delay(1000);
  
  digitalWrite(11, HIGH);
  digitalWrite(12, LOW);
  digitalWrite(13, LOW);
  Serial.print("1 0 0 = ");
  Serial.println(digitalRead(5));
  delay(1000);
  
  digitalWrite(11, HIGH);
  digitalWrite(12, LOW);
  digitalWrite(13, HIGH);
  Serial.print("1 0 1 = ");
  Serial.println(digitalRead(5));
  delay(1000);
  
  digitalWrite(11, HIGH);
  digitalWrite(12, HIGH);
  digitalWrite(13, LOW);
  Serial.print("1 1 0 = ");
  Serial.println(digitalRead(5));
  delay(1000);
  
  digitalWrite(11, HIGH);
  digitalWrite(12, HIGH);
  digitalWrite(13, HIGH);
  Serial.print("1 1 1 = ");
  Serial.println(digitalRead(5));
  delay(1000);
}

Uygulama-9:

int E = 2;
int D = 3;
int C = 4;
int P = 5;
int B = 6;
int A = 7;
int F = 8;
int G = 9;
void setup() {
  pinMode(E, OUTPUT);
  pinMode(D, OUTPUT);
  pinMode(C, OUTPUT);
  pinMode(P, OUTPUT);
  pinMode(B, OUTPUT);
  pinMode(A, OUTPUT);
  pinMode(F, OUTPUT);
  pinMode(G, OUTPUT);
  Serial.begin(9600);
}
void loop() {
  digitalWrite(E, LOW);
  digitalWrite(D, LOW);
  digitalWrite(C, LOW);
  digitalWrite(P, LOW);
  digitalWrite(B, LOW);
  digitalWrite(A, LOW);
  digitalWrite(F, LOW);
  digitalWrite(G, HIGH);
  Serial.println("0");
  
  delay(1000);
  
  digitalWrite(E, HIGH);
  digitalWrite(D, HIGH);
  digitalWrite(C, LOW);
  digitalWrite(P, LOW);
  digitalWrite(B, LOW);
  digitalWrite(A, HIGH);
  digitalWrite(F, HIGH);
  digitalWrite(G, HIGH);
  Serial.println("1");
  
  delay(1000);
  
  digitalWrite(E, LOW);
  digitalWrite(D, LOW);
  digitalWrite(C, HIGH);
  digitalWrite(P, LOW);
  digitalWrite(B, LOW);
  digitalWrite(A, LOW);
  digitalWrite(F, HIGH);
  digitalWrite(G, LOW);
  Serial.println("2");
  
  delay(1000);
  
  digitalWrite(E, HIGH);
  digitalWrite(D, LOW);
  digitalWrite(C, LOW);
  digitalWrite(P, LOW);
  digitalWrite(B, LOW);
  digitalWrite(A, LOW);
  digitalWrite(F, HIGH);
  digitalWrite(G, LOW);
  Serial.println("3");
  
  delay(1000);
  
  digitalWrite(E, HIGH);
  digitalWrite(D, HIGH);
  digitalWrite(C, LOW);
  digitalWrite(P, LOW);
  digitalWrite(B, LOW);
  digitalWrite(A, HIGH);
  digitalWrite(F, LOW);
  digitalWrite(G, LOW);
  Serial.println("4");
  
  delay(1000);
  
  digitalWrite(E, HIGH);
  digitalWrite(D, LOW);
  digitalWrite(C, LOW);
  digitalWrite(P, LOW);
  digitalWrite(B, HIGH);
  digitalWrite(A, LOW);
  digitalWrite(F, LOW);
  digitalWrite(G, LOW);
  Serial.println("5");
  
  delay(1000);
  
  digitalWrite(E, LOW);
  digitalWrite(D, LOW);
  digitalWrite(C, LOW);
  digitalWrite(P, LOW);
  digitalWrite(B, HIGH);
  digitalWrite(A, LOW);
  digitalWrite(F, LOW);
  digitalWrite(G, LOW);
  Serial.println("6");
  
  delay(1000);
  
  digitalWrite(E, HIGH);
  digitalWrite(D, HIGH);
  digitalWrite(C, LOW);
  digitalWrite(P, LOW);
  digitalWrite(B, LOW);
  digitalWrite(A, LOW);
  digitalWrite(F, HIGH);
  digitalWrite(G, HIGH);
  Serial.println("7");
  
  delay(1000);
  
  digitalWrite(E, LOW);
  digitalWrite(D, LOW);
  digitalWrite(C, LOW);
  digitalWrite(P, LOW);
  digitalWrite(B, LOW);
  digitalWrite(A, LOW);
  digitalWrite(F, LOW);
  digitalWrite(G, LOW);
  Serial.println("8");
  
  delay(1000);
  
  digitalWrite(E, HIGH);
  digitalWrite(D, LOW);
  digitalWrite(C, LOW);
  digitalWrite(P, LOW);
  digitalWrite(B, LOW);
  digitalWrite(A, LOW);
  digitalWrite(F, LOW);
  digitalWrite(G, LOW);
  Serial.println("9");
  
  delay(1000);
}

Uygulama-10:

int d1 = 2; // D1 --> 12
int d2 = 3; // D2 --> 9
int d3 = 4; // D3 --> 8
int d4 = 5; // D4 --> 6
int a = 6;  // A  --> 11
int b = 7;  // B  --> 7
int c = 8;  // C  --> 4
int d = 9;  // D  --> 2
int e = 10; // E  --> 1
int f = 11; // F  --> 10
int g = 12; // G  --> 5

void setup() {
  pinMode(d1, OUTPUT);
  pinMode(d2, OUTPUT);
  pinMode(d3, OUTPUT);
  pinMode(d4, OUTPUT);
  pinMode(a, OUTPUT);
  pinMode(b, OUTPUT);
  pinMode(c, OUTPUT);
  pinMode(d, OUTPUT);
  pinMode(e, OUTPUT);
  pinMode(f, OUTPUT);
  pinMode(g, OUTPUT);
  Serial.begin(9600);
}

void loop() {
  digitalWrite(d1, HIGH);
  digitalWrite(d2, LOW);
  digitalWrite(d3, LOW);
  digitalWrite(d4, LOW);
  digitalWrite(a, LOW);
  digitalWrite(b, LOW);
  digitalWrite(c, LOW);
  digitalWrite(d, LOW);
  digitalWrite(e, LOW);
  digitalWrite(f, LOW);
  digitalWrite(g, HIGH);

  delay(5);

  digitalWrite(d1, LOW);
  digitalWrite(d2, HIGH);
  digitalWrite(d3, LOW);
  digitalWrite(d4, LOW);
  digitalWrite(a, HIGH);
  digitalWrite(b, LOW);
  digitalWrite(c, LOW);
  digitalWrite(d, HIGH);
  digitalWrite(e, HIGH);
  digitalWrite(f, HIGH);
  digitalWrite(g, HIGH);

  delay(5);

  digitalWrite(d1, LOW);
  digitalWrite(d2, LOW);
  digitalWrite(d3, HIGH);
  digitalWrite(d4, LOW);
  digitalWrite(a, LOW);
  digitalWrite(b, LOW);
  digitalWrite(c, HIGH);
  digitalWrite(d, LOW);
  digitalWrite(e, LOW);
  digitalWrite(f, HIGH);
  digitalWrite(g, LOW);

  delay(5);

  digitalWrite(d1, LOW);
  digitalWrite(d2, LOW);
  digitalWrite(d3, LOW);
  digitalWrite(d4, HIGH);
  digitalWrite(a, LOW);
  digitalWrite(b, LOW);
  digitalWrite(c, LOW);
  digitalWrite(d, LOW);
  digitalWrite(e, HIGH);
  digitalWrite(f, HIGH);
  digitalWrite(g, LOW);

  delay(5);
}

Uygulama-11:

void setup() {
  pinMode(2, OUTPUT);
  pinMode(3, OUTPUT);
  pinMode(4, OUTPUT);
  pinMode(5, INPUT);
  pinMode(6, INPUT);
  Serial.begin(9600);
}

void loop() {
  digitalWrite(2, LOW);
  digitalWrite(3, LOW);
  digitalWrite(4, LOW);
  Serial.println(" 0 0 0 ");
  Serial.println(digitalRead(5));
  Serial.println(digitalRead(6));

  delay(1000);

  digitalWrite(2, LOW);
  digitalWrite(3, LOW);
  digitalWrite(4, HIGH);
  Serial.println(" 0 0 1 ");
  Serial.println(digitalRead(5));
  Serial.println(digitalRead(6));

  delay(1000);

  digitalWrite(2, LOW);
  digitalWrite(3, HIGH);
  digitalWrite(4, LOW);
  Serial.println(" 0 1 0 ");
  Serial.println(digitalRead(5));
  Serial.println(digitalRead(6));

  delay(1000);

  digitalWrite(2, LOW);
  digitalWrite(3, HIGH);
  digitalWrite(4, HIGH);
  Serial.println(" 0 1 1 ");
  Serial.println(digitalRead(5));
  Serial.println(digitalRead(6));

  delay(1000);

  digitalWrite(2, HIGH);
  digitalWrite(3, LOW);
  digitalWrite(4, LOW);
  Serial.println(" 1 0 0 ");
  Serial.println(digitalRead(5));
  Serial.println(digitalRead(6));

  delay(1000);

  digitalWrite(2, HIGH);
  digitalWrite(3, LOW);
  digitalWrite(4, HIGH);
  Serial.println(" 1 0 1 ");
  Serial.println(digitalRead(5));
  Serial.println(digitalRead(6));

  delay(1000);

  digitalWrite(2, HIGH);
  digitalWrite(3, HIGH);
  digitalWrite(4, LOW);
  Serial.println(" 1 1 0 ");
  Serial.println(digitalRead(5));
  Serial.println(digitalRead(6));

  delay(1000);

  digitalWrite(2, HIGH);
  digitalWrite(3, HIGH);
  digitalWrite(4, LOW);
  Serial.println(" 1 1 1 ");
  Serial.println(digitalRead(5));
  Serial.println(digitalRead(6));

  delay(1000);
}