Arduino 14 - kohutik

From DT^2
Revision as of 11:05, 6 August 2019 by Palo (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
#define SIRENA 12
void setup() {
  pinMode(SIRENA, OUTPUT);
}

void c(int dl)
{
  tone(SIRENA, 261);
  delay(dl);
    noTone(SIRENA);
  delay(50);
}

void d(int dl)
{
  tone(SIRENA, 294);
  delay(dl);
    noTone(SIRENA);
  delay(50);
}

void e(int dl)
{
  tone(SIRENA, 330);
  delay(dl);
    noTone(SIRENA);
  delay(50);
}

void f(int dl)
{
  tone(SIRENA, 349);
  delay(dl);
  noTone(SIRENA);
  delay(50);
}

void loop() {
  c(200); d(200); e(200); f(400); f(200); f(200);
  f(200); e(200); d(200); e(400); e(200); e(200);
  e(200); d(200); c(200); d(400); d(200); d(200);
  d(200); e(200); d(200); c(400); c(200); c(200);  
}