Buzzer Kullanımı







int buzzerPin = 2;
int notaSayisi = 8;
int C = 262;
int D = 294;
int E = 330;
int F = 349;
int G = 392;
int A = 440;
int B = 494;
int C_ = 523;
int notalar[] = {C, D, E, F, G, A, B, C_};

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

void loop()
{
    for (int i = 0; i < notaSayisi; i++)
  {
    tone(buzzerPin, notalar[i]);
    delay(500);
    noTone(buzzerPin);
    delay(20);
  }
  noTone(buzzerPin);
}




İstiklal Marşı Dosyası indir



Bu blogdaki popüler yayınlar

Arduino ile servo motor kulanımı

Potansiyometre ile servo motor kontrolü

Arduino ile potansiyometre kullanımı