Skip to content

Instantly share code, notes, and snippets.

@RobolinkAkademi
Last active October 28, 2019 07:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RobolinkAkademi/06124b541be133e9289f6dbc386635b7 to your computer and use it in GitHub Desktop.
Save RobolinkAkademi/06124b541be133e9289f6dbc386635b7 to your computer and use it in GitHub Desktop.
tum_yil_icin_arduino_mufredati_26
#include "pitches.h"
int F = 10;
ing G = 11;
int A = 12;
int B = 13;
int f[] = {NOTE_F5};
int g[] = {NOTE_G5};
int a[] = {NOTE_A5};
int b[] = {NOTE_B5};
int duration(500);
void setup() {
pinMode(F, INPUT_PULLUP);
pinMode(G, INPUT_PULLUP);
pinMode(A, INPUT_PULLUP);
pinMode(B, INPUT_PULLUP);
void loop() {
if (digitalRead(F) == LOW) {
for (int Note = 0; Note <1; Note++)
{
tone(6, f[Note], duration);
}
}
if (digitalWrite(G) == LOW) {
for (int Note = 0; Note < 1; Note++) {
tone(6, g[Note], duration);
}
}
if (digitalRead(A) == LOW) {
for (int Note = 0; Note < 1; Note++) {
tone(6, b[Note], duration);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment